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


C++ ModifierTypeInfo类代码示例

本文整理汇总了C++中ModifierTypeInfo的典型用法代码示例。如果您正苦于以下问题:C++ ModifierTypeInfo类的具体用法?C++ ModifierTypeInfo怎么用?C++ ModifierTypeInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ModifierTypeInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: modifiers_getCageIndex

/* used for buttons, to find out if the 'draw deformed in editmode' option is
 * there
 * 
 * also used in transform_conversion.c, to detect CrazySpace [tm] (2nd arg
 * then is NULL) 
 * also used for some mesh tools to give warnings
 */
int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *lastPossibleCageIndex_r, int virtual_)
{
	ModifierData *md = (virtual_)? modifiers_getVirtualModifierList(ob): ob->modifiers.first;
	int i, cageIndex = -1;

	if(lastPossibleCageIndex_r) {
		/* ensure the value is initialized */
		*lastPossibleCageIndex_r= -1;
	}

	/* Find the last modifier acting on the cage. */
	for (i=0; md; i++,md=md->next) {
		ModifierTypeInfo *mti = modifierType_getInfo(md->type);

		md->scene= scene;

		if (!(md->mode & eModifierMode_Realtime)) continue;
		if (!(md->mode & eModifierMode_Editmode)) continue;
		if (mti->isDisabled && mti->isDisabled(md, 0)) continue;
		if (!(mti->flags & eModifierTypeFlag_SupportsEditmode)) continue;
		if (md->mode & eModifierMode_DisableTemporary) continue;

		if (!modifier_supportsMapping(md))
			break;

		if (lastPossibleCageIndex_r) *lastPossibleCageIndex_r = i;
		if (md->mode & eModifierMode_OnCage)
			cageIndex = i;
	}

	return cageIndex;
}
开发者ID:,项目名称:,代码行数:39,代码来源:

示例2: modifier_free

void modifier_free(ModifierData *md) 
{
	ModifierTypeInfo *mti = modifierType_getInfo(md->type);

	if (mti->freeData) mti->freeData(md);
	if (md->error) MEM_freeN(md->error);

	MEM_freeN(md);
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例3: modifier_copyData

void modifier_copyData(ModifierData *md, ModifierData *target)
{
	ModifierTypeInfo *mti = modifierType_getInfo(md->type);

	target->mode = md->mode;

	if (mti->copyData)
		mti->copyData(md, target);
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例4: modifier_supportsCage

bool modifier_supportsCage(struct Scene *scene, ModifierData *md)
{
	ModifierTypeInfo *mti = modifierType_getInfo(md->type);

	md->scene = scene;

	return ((!mti->isDisabled || !mti->isDisabled(md, 0)) &&
	        (mti->flags & eModifierTypeFlag_SupportsEditmode) &&
	        modifier_supportsMapping(md));
}
开发者ID:JT-a,项目名称:blender-lukas_t,代码行数:10,代码来源:modifier.c

示例5: modifiers_foreachTexLink

void modifiers_foreachTexLink(Object *ob, TexWalkFunc walk, void *userData)
{
	ModifierData *md = ob->modifiers.first;

	for (; md; md=md->next) {
		ModifierTypeInfo *mti = modifierType_getInfo(md->type);

		if(mti->foreachTexLink)
			mti->foreachTexLink(md, ob, walk, userData);
	}
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例6: modifier_couldBeCage

int modifier_couldBeCage(struct Scene *scene, ModifierData *md)
{
	ModifierTypeInfo *mti = modifierType_getInfo(md->type);

	md->scene= scene;

	return (	(md->mode & eModifierMode_Realtime) &&
			(md->mode & eModifierMode_Editmode) &&
			(!mti->isDisabled || !mti->isDisabled(md, 0)) &&
			modifier_supportsMapping(md));	
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例7: modifierType_getInfo

CDMaskLink *modifiers_calcDataMasks(struct Scene *scene, Object *ob, ModifierData *md,
                                    CustomDataMask dataMask, int required_mode,
                                    ModifierData *previewmd, CustomDataMask previewmask)
{
	CDMaskLink *dataMasks = NULL;
	CDMaskLink *curr, *prev;

	/* build a list of modifier data requirements in reverse order */
	for (; md; md = md->next) {
		ModifierTypeInfo *mti = modifierType_getInfo(md->type);

		curr = MEM_callocN(sizeof(CDMaskLink), "CDMaskLink");
		
		if (modifier_isEnabled(scene, md, required_mode)) {
			if (mti->requiredDataMask)
				curr->mask = mti->requiredDataMask(ob, md);

			if (previewmd == md) {
				curr->mask |= previewmask;
			}
		}

		/* prepend new datamask */
		curr->next = dataMasks;
		dataMasks = curr;
	}

	/* build the list of required data masks - each mask in the list must
	 * include all elements of the masks that follow it
	 *
	 * note the list is currently in reverse order, so "masks that follow it"
	 * actually means "masks that precede it" at the moment
	 */
	for (curr = dataMasks, prev = NULL; curr; prev = curr, curr = curr->next) {
		if (prev) {
			CustomDataMask prev_mask = prev->mask;
			CustomDataMask curr_mask = curr->mask;

			curr->mask = curr_mask | prev_mask;
		}
		else {
			CustomDataMask curr_mask = curr->mask;

			curr->mask = curr_mask | dataMask;
		}
	}

	/* reverse the list so it's in the correct order */
	BLI_linklist_reverse((LinkNode **)&dataMasks);

	return dataMasks;
}
开发者ID:JT-a,项目名称:blender-lukas_t,代码行数:52,代码来源:modifier.c

示例8: curve_calc_orcodm

static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFinal, int forRender)
{
	/* this function represents logic of mesh's orcodm calculation */
	/* for displist-based objects */

	ModifierData *md = modifiers_getVirtualModifierList(ob);
	ModifierData *preTesselatePoint;
	Curve *cu= ob->data;
	int required_mode;
	int editmode = (!forRender && cu->editnurb);
	DerivedMesh *ndm, *orcodm= NULL;

	if(forRender) required_mode = eModifierMode_Render;
	else required_mode = eModifierMode_Realtime;

	preTesselatePoint = curve_get_tesselate_point(scene, ob, forRender, editmode);

	if(editmode) required_mode |= eModifierMode_Editmode;

	if (preTesselatePoint) {
		md = preTesselatePoint->next;
	}

	for (; md; md=md->next) {
		ModifierTypeInfo *mti = modifierType_getInfo(md->type);

		md->scene= scene;

		if ((md->mode & required_mode) != required_mode) continue;
		if (mti->isDisabled && mti->isDisabled(md, forRender)) continue;
		if (mti->type!=eModifierTypeType_Constructive) continue;

		if(!orcodm)
			orcodm= create_orco_dm(scene, ob);

		ndm = mti->applyModifier(md, ob, orcodm, forRender, 0);

		if(ndm) {
			/* if the modifier returned a new dm, release the old one */
			if(orcodm && orcodm != ndm) {
				orcodm->release(orcodm);
			}
			orcodm = ndm;
		}
	}

	/* add an orco layer if needed */
	add_orco_dm(scene, ob, derivedFinal, orcodm);

	if(orcodm)
		orcodm->release(orcodm);
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:52,代码来源:displist.c

示例9: modifier_isEnabled

bool modifier_isEnabled(struct Scene *scene, ModifierData *md, int required_mode)
{
	ModifierTypeInfo *mti = modifierType_getInfo(md->type);

	md->scene = scene;

	if ((md->mode & required_mode) != required_mode) return false;
	if (mti->isDisabled && mti->isDisabled(md, required_mode == eModifierMode_Render)) return false;
	if (md->mode & eModifierMode_DisableTemporary) return false;
	if ((required_mode & eModifierMode_Editmode) && !(mti->flags & eModifierTypeFlag_SupportsEditmode)) return false;
	
	return true;
}
开发者ID:akonneker,项目名称:blensor,代码行数:13,代码来源:modifier.c

示例10: modwrap_deformVertsEM

void modwrap_deformVertsEM(
        ModifierData *md, Object *ob,
        struct BMEditMesh *em, DerivedMesh *dm,
        float (*vertexCos)[3], int numVerts)
{
	ModifierTypeInfo *mti = modifierType_getInfo(md->type);
	BLI_assert(!dm || CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);

	if (dm && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
		DM_ensure_normals(dm);
	}
	mti->deformVertsEM(md, ob, em, dm, vertexCos, numVerts);
}
开发者ID:JT-a,项目名称:blender-lukas_t,代码行数:13,代码来源:modifier.c

示例11: editmesh_get_first_deform_matrices

int editmesh_get_first_deform_matrices(Scene *scene, Object *ob, EditMesh *em, float (**deformmats)[3][3], float (**deformcos)[3])
{
	ModifierData *md;
	DerivedMesh *dm;
	int i, a, numleft = 0, numVerts = 0;
	int cageIndex = modifiers_getCageIndex(scene, ob, NULL, 1);
	float (*defmats)[3][3] = NULL, (*deformedVerts)[3] = NULL;

	modifiers_clearErrors(ob);

	dm = NULL;
	md = modifiers_getVirtualModifierList(ob);

	/* compute the deformation matrices and coordinates for the first
	   modifiers with on cage editing that are enabled and support computing
	   deform matrices */
	for(i = 0; md && i <= cageIndex; i++, md = md->next) {
		ModifierTypeInfo *mti = modifierType_getInfo(md->type);

		if(!editmesh_modifier_is_enabled(scene, md, dm))
			continue;

		if(mti->type==eModifierTypeType_OnlyDeform && mti->deformMatricesEM) {
			if(!defmats) {
				dm= editmesh_get_derived(em, NULL);
				deformedVerts= editmesh_get_vertex_cos(em, &numVerts);
				defmats= MEM_callocN(sizeof(*defmats)*numVerts, "defmats");

				for(a=0; a<numVerts; a++)
					unit_m3(defmats[a]);
			}

			mti->deformMatricesEM(md, ob, em, dm, deformedVerts, defmats,
				numVerts);
		}
		else
			break;
	}

	for(; md && i <= cageIndex; md = md->next, i++)
		if(editmesh_modifier_is_enabled(scene, md, dm) && modifier_isCorrectableDeformed(md))
			numleft++;

	if(dm)
		dm->release(dm);

	*deformmats= defmats;
	*deformcos= deformedVerts;

	return numleft;
}
开发者ID:,项目名称:,代码行数:51,代码来源:

示例12: modifiers_foreachIDLink

void modifiers_foreachIDLink(Object *ob, IDWalkFunc walk, void *userData)
{
	ModifierData *md = ob->modifiers.first;

	for (; md; md=md->next) {
		ModifierTypeInfo *mti = modifierType_getInfo(md->type);

		if(mti->foreachIDLink) mti->foreachIDLink(md, ob, walk, userData);
		else if(mti->foreachObjectLink) {
			/* each Object can masquerade as an ID, so this should be OK */
			ObjectWalkFunc fp = (ObjectWalkFunc)walk;
			mti->foreachObjectLink(md, ob, fp, userData);
		}
	}
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例13: modifierType_getInfo

ModifierData *modifier_new(int type)
{
    ModifierTypeInfo *mti = modifierType_getInfo(type);
    ModifierData *md = MEM_callocN(mti->structSize, mti->structName);

    /* note, this name must be made unique later */
    BLI_strncpy(md->name, mti->name, sizeof(md->name));

    md->type = type;
    md->mode = eModifierMode_Realtime | eModifierMode_Render | eModifierMode_Expanded;

    if (mti->flags & eModifierTypeFlag_EnableInEditmode)
        md->mode |= eModifierMode_Editmode;

    if (mti->initData) mti->initData(md);

    return md;
}
开发者ID:nttputus,项目名称:blensor,代码行数:18,代码来源:modifier.c

示例14: modifierType_getInfo

ModifierData *modifier_new(int type)
{
	ModifierTypeInfo *mti = modifierType_getInfo(type);
	ModifierData *md = MEM_callocN(mti->structSize, mti->structName);
	
	// FIXME: we need to make the name always be unique somehow...
	strcpy(md->name, mti->name);

	md->type = type;
	md->mode = eModifierMode_Realtime
			| eModifierMode_Render | eModifierMode_Expanded;

	if (mti->flags & eModifierTypeFlag_EnableInEditmode)
		md->mode |= eModifierMode_Editmode;

	if (mti->initData) mti->initData(md);

	return md;
}
开发者ID:,项目名称:,代码行数:19,代码来源:

示例15: BKE_lattice_modifiers_calc

void BKE_lattice_modifiers_calc(Scene *scene, Object *ob)
{
	Lattice *lt = ob->data;
	VirtualModifierData virtualModifierData;
	ModifierData *md = modifiers_getVirtualModifierList(ob, &virtualModifierData);
	float (*vertexCos)[3] = NULL;
	int numVerts, editmode = (lt->editlatt != NULL);

	if (ob->curve_cache) {
		BKE_displist_free(&ob->curve_cache->disp);
	}
	else {
		ob->curve_cache = MEM_callocN(sizeof(CurveCache), "CurveCache for lattice");
	}

	for (; md; md = md->next) {
		ModifierTypeInfo *mti = modifierType_getInfo(md->type);

		md->scene = scene;
		
		if (!(md->mode & eModifierMode_Realtime)) continue;
		if (editmode && !(md->mode & eModifierMode_Editmode)) continue;
		if (mti->isDisabled && mti->isDisabled(md, 0)) continue;
		if (mti->type != eModifierTypeType_OnlyDeform) continue;

		if (!vertexCos) vertexCos = BKE_lattice_vertexcos_get(ob, &numVerts);
		mti->deformVerts(md, ob, NULL, vertexCos, numVerts, 0);
	}

	/* always displist to make this work like derivedmesh */
	if (!vertexCos) vertexCos = BKE_lattice_vertexcos_get(ob, &numVerts);
	
	{
		DispList *dl = MEM_callocN(sizeof(*dl), "lt_dl");
		dl->type = DL_VERTS;
		dl->parts = 1;
		dl->nr = numVerts;
		dl->verts = (float *) vertexCos;
		
		BLI_addtail(&ob->curve_cache->disp, dl);
	}
}
开发者ID:JT-a,项目名称:blender-lukas_t,代码行数:42,代码来源:lattice.c


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