当前位置: 首页>>代码示例>>C++>>正文


C++ KX_BlenderMaterial类代码示例

本文整理汇总了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;
}
开发者ID:danielmarg,项目名称:blender-main,代码行数:28,代码来源:KX_MeshProxy.cpp

示例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;
}
开发者ID:SuriyaaKudoIsc,项目名称:blender-git,代码行数:11,代码来源:KX_BlenderMaterial.cpp

示例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);
}
开发者ID:mgschwan,项目名称:blensor,代码行数:52,代码来源:KX_BlenderMaterial.cpp

示例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;
}
开发者ID:DrangPo,项目名称:blender,代码行数:19,代码来源:KX_MeshProxy.cpp

示例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]);
}
开发者ID:SuriyaaKudoIsc,项目名称:blender-git,代码行数:6,代码来源:KX_BlenderMaterial.cpp

示例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());
}
开发者ID:SuriyaaKudoIsc,项目名称:blender-git,代码行数:5,代码来源:KX_BlenderMaterial.cpp

示例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);
}
开发者ID:SuriyaaKudoIsc,项目名称:blender-git,代码行数:5,代码来源:KX_BlenderMaterial.cpp


注:本文中的KX_BlenderMaterial类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。