~ubuntu-branches/ubuntu/intrepid/blender/intrepid-updates

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-08-08 02:45:40 UTC
  • mfrom: (12.1.14 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080808024540-kkjp7ekfivzhuw3l
Tags: 2.46+dfsg-4
* Fix python syntax warning in import_dxf.py, which led to nasty output
  in installation/upgrade logs during byte-compilation, using a patch
  provided by the script author (Closes: #492280):
   - debian/patches/45_fix_python_syntax_warning

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
2
// Replace the mesh for this actuator's parent
3
3
//
4
 
// $Id: KX_SCA_ReplaceMeshActuator.cpp,v 1.9 2005/03/09 19:45:59 lukep Exp $
 
4
// $Id: KX_SCA_ReplaceMeshActuator.cpp 14444 2008-04-16 22:40:48Z hos $
5
5
//
6
 
// ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
 
6
// ***** BEGIN GPL LICENSE BLOCK *****
7
7
//
8
8
// This program is free software; you can redistribute it and/or
9
9
// modify it under the terms of the GNU General Public License
10
10
// as published by the Free Software Foundation; either version 2
11
 
// of the License, or (at your option) any later version. The Blender
12
 
// Foundation also sells licenses for use in proprietary software under
13
 
// the Blender License.  See http://www.blender.org/BL/ for information
14
 
// about this.
 
11
// of the License, or (at your option) any later version.
15
12
//
16
13
// This program is distributed in the hope that it will be useful,
17
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
29
26
//
30
27
// Contributor(s): none yet.
31
28
//
32
 
// ***** END GPL/BL DUAL LICENSE BLOCK *****
 
29
// ***** END GPL LICENSE BLOCK *****
33
30
 
34
31
//
35
32
// Previously existed as:
83
80
 
84
81
 
85
82
PyMethodDef KX_SCA_ReplaceMeshActuator::Methods[] = {
86
 
  {"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_VARARGS, SetMesh_doc},
87
 
  KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, getMesh),
88
 
  {NULL,NULL} //Sentinel
 
83
        {"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_VARARGS, SetMesh_doc},
 
84
        
 
85
        KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, instantReplaceMesh),
 
86
        KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, getMesh),
 
87
        {NULL,NULL} //Sentinel
89
88
};
90
89
 
91
90
 
135
134
        return PyString_FromString(const_cast<char *>(m_mesh->GetName().ReadPtr()));
136
135
}
137
136
 
 
137
 
 
138
KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh,
 
139
"instantReplaceMesh() : immediately replace mesh without delay\n")
 
140
{
 
141
        InstantReplaceMesh();
 
142
        Py_Return;
 
143
}
 
144
 
138
145
/* ------------------------------------------------------------------------- */
139
146
/* Native functions                                                          */
140
147
/* ------------------------------------------------------------------------- */
191
198
        return replica;
192
199
};
193
200
 
 
201
void KX_SCA_ReplaceMeshActuator::InstantReplaceMesh()
 
202
{
 
203
        if (m_mesh) m_scene->ReplaceMesh(GetParent(),m_mesh);
 
204
}
 
205
 
194
206
/* eof */