예제 #1
0
파일: gpu.c 프로젝트: 244xiao/blender
static PyObject *PyInit_gpu(void)
{
	PyObject *m;

	m = PyModule_Create(&gpumodule);
	if (m == NULL)
		return NULL;

	/* device constants */
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_VIEWMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_MAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_VIEWIMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_IMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_COLOR);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNVEC);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNCO);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNIMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNPERSMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNENERGY);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNCOL);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_SAMPLER_2DBUFFER);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_SAMPLER_2DIMAGE);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_SAMPLER_2DSHADOW);

	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_1I);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_1F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_2F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_3F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_4F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_9F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_16F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_4UB);

	PY_MODULE_ADD_CONSTANT(m, CD_MTFACE);
	PY_MODULE_ADD_CONSTANT(m, CD_ORCO);
	PY_MODULE_ADD_CONSTANT(m, CD_TANGENT);
	PY_MODULE_ADD_CONSTANT(m, CD_MCOL);
	return m;
}
예제 #2
0
파일: gpu.c 프로젝트: UPBGE/blender
static PyObject *PyInit_gpu(void)
{
	PyObject *m;

	m = PyModule_Create(&gpumodule);
	if (m == NULL)
		return NULL;


	/* Take care to update docs when editing: 'doc/python_api/rst/gpu.rst' */


	/* -------------------------------------------------------------------- */
	/* GPUDynamicType */

	/* device constant groups */
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_GROUP_MISC);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_GROUP_LAMP);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_GROUP_OBJECT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_GROUP_SAMPLER);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_GROUP_MIST);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_GROUP_WORLD);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_GROUP_MAT);

	/* device constants */
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_NONE);
	/* GPU_DYNAMIC_GROUP_OBJECT */
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_VIEWMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_MAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_VIEWIMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_IMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_LOCTOVIEWMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_LOCTOVIEWIMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_COLOR);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE);
	/* GPU_DYNAMIC_GROUP_LAMP */
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNVEC);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNCO);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNIMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNPERSMAT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNENERGY);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNCOL);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNSPOTSCALE);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_ATT1);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_ATT2);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DISTANCE);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_SPOTSIZE);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_SPOTBLEND);
	/* GPU_DYNAMIC_GROUP_SAMPLER */
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_SAMPLER_2DBUFFER);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_SAMPLER_2DIMAGE);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_SAMPLER_2DSHADOW);
	/* GPU_DYNAMIC_GROUP_MIST */
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_ENABLE);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_START);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_DISTANCE);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_INTENSITY);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_TYPE);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_COLOR);
	/* GPU_DYNAMIC_GROUP_WORLD */
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_HORIZON_COLOR);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_AMBIENT_COLOR);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_ZENITH_COLOR);
	/* GPU_DYNAMIC_GROUP_MAT */
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_DIFFRGB);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_REF);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_SPECRGB);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_SPEC);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_HARD);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_EMIT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_AMB);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_ALPHA);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_MIR);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_SPECTRA);
	/* GPU_DYNAMIC_GROUP_TEX */
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_COLINTENS);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_COLFAC);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_ALPHA);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_SPECINTENS);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_SPECFAC);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_HARDNESS);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_EMIT);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_MIRROR);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_NORMAL);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_PARALLAXBUMP);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_PARALLAXSTEP);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_IOR);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_REFRRATIO);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_UVOFFSET);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_UVSIZE);
	PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_TEX_UVROTATION);


	/* -------------------------------------------------------------------- */
	/* GPUDataType */

	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_1I);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_1F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_2F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_3F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_4F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_9F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_16F);
	PY_MODULE_ADD_CONSTANT(m, GPU_DATA_4UB);


	/* -------------------------------------------------------------------- */
	/* CustomDataType
	 *
	 * Intentionally only include the subset used by the GPU API.
	 */
	PY_MODULE_ADD_CONSTANT(m, CD_MTFACE);
	PY_MODULE_ADD_CONSTANT(m, CD_ORCO);
	PY_MODULE_ADD_CONSTANT(m, CD_TANGENT);
	PY_MODULE_ADD_CONSTANT(m, CD_MCOL);
	return m;
}