~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/gameengine/Ketsji/KX_MeshProxy.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: KX_MeshProxy.cpp,v 1.4 2004/03/22 22:01:52 jesterking Exp $
 
2
 * $Id: KX_MeshProxy.cpp,v 1.9 2005/04/23 12:25:21 kester Exp $
3
3
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or
29
29
 * ***** END GPL/BL DUAL LICENSE BLOCK *****
30
30
 */
31
31
 
 
32
#ifdef HAVE_CONFIG_H
 
33
#include <config.h>
 
34
#endif
 
35
 
32
36
#include "KX_MeshProxy.h"
33
37
#include "RAS_IPolygonMaterial.h"
34
38
#include "RAS_MeshObject.h"
 
39
 
35
40
#include "KX_VertexProxy.h"
36
41
 
37
 
#ifdef HAVE_CONFIG_H
38
 
#include <config.h>
39
 
#endif
 
42
#include "KX_PolygonMaterial.h"
 
43
 
 
44
#include "KX_PyMath.h"
 
45
#include "KX_ConvertPhysicsObject.h"
40
46
 
41
47
PyTypeObject KX_MeshProxy::Type = {
42
48
        PyObject_HEAD_INIT(&PyType_Type)
70
76
{"getTextureName", (PyCFunction)KX_MeshProxy::sPyGetTextureName,METH_VARARGS},
71
77
{"getVertexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetVertexArrayLength,METH_VARARGS},
72
78
{"getVertex", (PyCFunction)KX_MeshProxy::sPyGetVertex,METH_VARARGS},
 
79
KX_PYMETHODTABLE(KX_MeshProxy, reinstancePhysicsMesh),
73
80
//{"getIndexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetIndexArrayLength,METH_VARARGS},
74
81
 
75
82
  {NULL,NULL} //Sentinel
76
83
};
77
84
 
78
85
PyObject*
79
 
KX_MeshProxy::_getattr(char* attr)
 
86
KX_MeshProxy::_getattr(const STR_String& attr)
80
87
{
81
 
  _getattr_up(SCA_IObject);
 
88
        if (attr == "materials")
 
89
        {
 
90
                PyObject *materials = PyList_New(0); /* new ref */
 
91
                RAS_MaterialBucket::Set::iterator mit = m_meshobj->GetFirstMaterial();
 
92
                for(; mit != m_meshobj->GetLastMaterial(); ++mit)
 
93
                        PyList_Append(materials, static_cast<KX_PolygonMaterial*>((*mit)->GetPolyMaterial()));
 
94
                return materials;
 
95
        }
 
96
                
 
97
        _getattr_up(SCA_IObject);
82
98
}
83
99
 
84
100
 
193
209
        return vertexob;
194
210
                
195
211
}
 
212
 
 
213
KX_PYMETHODDEF_DOC(KX_MeshProxy, reinstancePhysicsMesh,
 
214
"Reinstance the physics mesh.")
 
215
{
 
216
        return Py_Success(KX_ReInstanceShapeFromMesh(m_meshobj));
 
217
}