本文整理汇总了C++中KX_BlenderMaterial类的典型用法代码示例。如果您正苦于以下问题:C++ KX_BlenderMaterial类的具体用法?C++ KX_BlenderMaterial怎么用?C++ KX_BlenderMaterial使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KX_BlenderMaterial类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PyList_New
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: pyattr_set_blending
int KX_BlenderMaterial::pyattr_set_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
{
KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v);
PyObject *obj = self->PysetBlending(value, NULL);
if (obj)
{
Py_DECREF(obj);
return 0;
}
return -1;
}
示例3: if
void
KX_BlenderMaterial::ActivateMat(
RAS_IRasterizer* rasty,
TCachingInfo& cachingInfo
)const
{
KX_BlenderMaterial *tmp = const_cast<KX_BlenderMaterial*>(this);
if (mLastShader) {
mLastShader->SetProg(false);
mLastShader= NULL;
}
if (mLastBlenderShader) {
mLastBlenderShader->SetProg(false);
mLastBlenderShader= NULL;
}
if (GetCachingInfo() != cachingInfo) {
if (!cachingInfo)
tmp->setTexData( false,rasty );
cachingInfo = GetCachingInfo();
if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED)
tmp->setTexData( true,rasty );
else if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && mMaterial->alphablend != GEMAT_SOLID && !rasty->GetUsingOverrideShader())
tmp->setTexData(true, rasty);
else
tmp->setTexData( false,rasty);
if (mMaterial->ras_mode &TWOSIDED)
rasty->SetCullFace(false);
else
rasty->SetCullFace(true);
if ((mMaterial->ras_mode &WIRE) ||
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
{
if (mMaterial->ras_mode &WIRE)
rasty->SetCullFace(false);
rasty->SetLines(true);
}
else
rasty->SetLines(false);
ActivatGLMaterials(rasty);
ActivateTexGen(rasty);
}
//ActivatGLMaterials(rasty);
//ActivateTexGen(rasty);
}
示例4: PyList_New
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;
}
示例5: Py_BuildValue
PyObject *KX_BlenderMaterial::pyattr_get_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v);
unsigned int* bfunc = self->getBlendFunc();
return Py_BuildValue("(ll)", (long int)bfunc[0], (long int)bfunc[1]);
}
示例6: PyLong_FromLong
PyObject *KX_BlenderMaterial::pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v);
return PyLong_FromLong(self->GetMaterialIndex());
}
示例7:
PyObject *KX_BlenderMaterial::pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v);
return self->PygetShader(NULL, NULL);
}