本文整理汇总了C++中KX_BlenderMaterial::GetProxy方法的典型用法代码示例。如果您正苦于以下问题:C++ KX_BlenderMaterial::GetProxy方法的具体用法?C++ KX_BlenderMaterial::GetProxy怎么用?C++ KX_BlenderMaterial::GetProxy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KX_BlenderMaterial
的用法示例。
在下文中一共展示了KX_BlenderMaterial::GetProxy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
PyObject *KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
KX_MeshProxy* self = static_cast<KX_MeshProxy*>(self_v);
int tot= self->m_meshobj->NumMaterials();
int i;
PyObject *materials = PyList_New( tot );
list<RAS_MeshMaterial>::iterator mit= self->m_meshobj->GetFirstMaterial();
for (i=0; i<tot; mit++, i++) {
RAS_IPolyMaterial *polymat = mit->m_bucket->GetPolyMaterial();
/* Why do we need to check for RAS_BLENDERMAT if both are cast to a (PyObject *)? - Campbell */
if (polymat->GetFlag() & RAS_BLENDERMAT)
{
KX_BlenderMaterial *mat = static_cast<KX_BlenderMaterial*>(polymat);
PyList_SET_ITEM(materials, i, mat->GetProxy());
}
else {
KX_PolygonMaterial *mat = static_cast<KX_PolygonMaterial*>(polymat);
PyList_SET_ITEM(materials, i, mat->GetProxy());
}
}
return materials;
}
示例2:
PyObject *KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
KX_MeshProxy* self = static_cast<KX_MeshProxy*>(self_v);
int tot= self->m_meshobj->NumMaterials();
int i;
PyObject *materials = PyList_New( tot );
list<RAS_MeshMaterial>::iterator mit= self->m_meshobj->GetFirstMaterial();
for (i=0; i<tot; mit++, i++) {
RAS_IPolyMaterial *polymat = mit->m_bucket->GetPolyMaterial();
KX_BlenderMaterial *mat = static_cast<KX_BlenderMaterial *>(polymat);
PyList_SET_ITEM(materials, i, mat->GetProxy());
}
return materials;
}