forked from bartvdbraak/blender
Fixing a crash when using either BL_ArmatureBone.parent and BL_ArmatureBone.children.
This commit is contained in:
parent
1e816635b0
commit
eabbbcdff9
@ -432,13 +432,13 @@ PyAttributeDef BL_ArmatureBone::AttributesPtr[] = {
|
|||||||
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("arm_mat",Bone,arm_mat,4),
|
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("arm_mat",Bone,arm_mat,4),
|
||||||
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("bone_mat",Bone,bone_mat,4),
|
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("bone_mat",Bone,bone_mat,4),
|
||||||
KX_PYATTRIBUTE_RO_FUNCTION("parent",BL_ArmatureBone,py_bone_get_parent),
|
KX_PYATTRIBUTE_RO_FUNCTION("parent",BL_ArmatureBone,py_bone_get_parent),
|
||||||
KX_PYATTRIBUTE_RO_FUNCTION("children",BL_ArmatureBone,py_bone_get_parent),
|
KX_PYATTRIBUTE_RO_FUNCTION("children",BL_ArmatureBone,py_bone_get_children),
|
||||||
{ NULL } //Sentinel
|
{ NULL } //Sentinel
|
||||||
};
|
};
|
||||||
|
|
||||||
PyObject *BL_ArmatureBone::py_bone_get_parent(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
PyObject *BL_ArmatureBone::py_bone_get_parent(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||||
{
|
{
|
||||||
Bone* bone = reinterpret_cast<Bone*>BGE_PROXY_PTR(self);
|
Bone* bone = reinterpret_cast<Bone*>(self);
|
||||||
if (bone->parent) {
|
if (bone->parent) {
|
||||||
// create a proxy unconnected to any GE object
|
// create a proxy unconnected to any GE object
|
||||||
return NewProxyPlus_Ext(NULL,&Type,bone->parent,false);
|
return NewProxyPlus_Ext(NULL,&Type,bone->parent,false);
|
||||||
@ -448,7 +448,7 @@ PyObject *BL_ArmatureBone::py_bone_get_parent(void *self, const struct KX_PYATTR
|
|||||||
|
|
||||||
PyObject *BL_ArmatureBone::py_bone_get_children(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
PyObject *BL_ArmatureBone::py_bone_get_children(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||||
{
|
{
|
||||||
Bone* bone = reinterpret_cast<Bone*>BGE_PROXY_PTR(self);
|
Bone* bone = reinterpret_cast<Bone*>(self);
|
||||||
Bone* child;
|
Bone* child;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (child=(Bone*)bone->childbase.first; child; child=(Bone*)child->next)
|
for (child=(Bone*)bone->childbase.first; child; child=(Bone*)child->next)
|
||||||
|
@ -278,7 +278,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *
|
|||||||
// the attribute has no field correspondance, handover processing to function.
|
// the attribute has no field correspondance, handover processing to function.
|
||||||
if (attrdef->m_getFunction == NULL)
|
if (attrdef->m_getFunction == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
return (*attrdef->m_getFunction)(ref, attrdef);
|
return (*attrdef->m_getFunction)(ptr, attrdef);
|
||||||
}
|
}
|
||||||
ptr += attrdef->m_offset;
|
ptr += attrdef->m_offset;
|
||||||
if (attrdef->m_length > 1)
|
if (attrdef->m_length > 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user