本文整理汇总了C++中ModifierTypeInfo::isDisabled方法的典型用法代码示例。如果您正苦于以下问题:C++ ModifierTypeInfo::isDisabled方法的具体用法?C++ ModifierTypeInfo::isDisabled怎么用?C++ ModifierTypeInfo::isDisabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModifierTypeInfo
的用法示例。
在下文中一共展示了ModifierTypeInfo::isDisabled方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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));
}
示例3: 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));
}
示例4: 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);
}
示例5: 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;
}
示例6: 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);
}
}
示例7: 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 *r_lastPossibleCageIndex, bool is_virtual)
{
VirtualModifierData virtualModifierData;
ModifierData *md = (is_virtual) ? modifiers_getVirtualModifierList(ob, &virtualModifierData) : ob->modifiers.first;
int i, cageIndex = -1;
if (r_lastPossibleCageIndex) {
/* ensure the value is initialized */
*r_lastPossibleCageIndex = -1;
}
/* Find the last modifier acting on the cage. */
for (i = 0; md; i++, md = md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
bool supports_mapping;
md->scene = scene;
if (mti->isDisabled && mti->isDisabled(md, 0)) continue;
if (!(mti->flags & eModifierTypeFlag_SupportsEditmode)) continue;
if (md->mode & eModifierMode_DisableTemporary) continue;
supports_mapping = modifier_supportsMapping(md);
if (r_lastPossibleCageIndex && supports_mapping) {
*r_lastPossibleCageIndex = i;
}
if (!(md->mode & eModifierMode_Realtime)) continue;
if (!(md->mode & eModifierMode_Editmode)) continue;
if (!supports_mapping)
break;
if (md->mode & eModifierMode_OnCage)
cageIndex = i;
}
return cageIndex;
}
示例8: curve_calc_modifiers_post
static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispbase,
DerivedMesh **derivedFinal, int forRender, float (*originalVerts)[3], float (*deformedVerts)[3])
{
ModifierData *md = modifiers_getVirtualModifierList(ob);
ModifierData *preTesselatePoint;
Curve *cu= ob->data;
ListBase *nurb= BKE_curve_nurbs(cu);
int required_mode = 0, totvert = 0;
int editmode = (!forRender && cu->editnurb);
DerivedMesh *dm= NULL, *ndm;
float (*vertCos)[3] = 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;
}
if (derivedFinal && *derivedFinal) {
(*derivedFinal)->release (*derivedFinal);
}
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_OnlyDeform ||
(mti->type == eModifierTypeType_DeformOrConstruct && !dm)) {
if (dm) {
if (!vertCos) {
totvert = dm->getNumVerts(dm);
vertCos = MEM_mallocN(sizeof(*vertCos) * totvert, "dfmv");
dm->getVertCos(dm, vertCos);
}
mti->deformVerts(md, ob, dm, vertCos, totvert, forRender, editmode);
} else {
if (!vertCos) {
vertCos= displist_get_allverts(dispbase, &totvert);
}
mti->deformVerts(md, ob, NULL, vertCos, totvert, forRender, editmode);
}
} else {
if (!derivedFinal) {
/* makeDisplistCurveTypes could be used for beveling, where derived mesh */
/* is totally unnecessary, so we could stop modifiers applying */
/* when we found constructive modifier but derived mesh is unwanted result */
break;
}
if (dm) {
if (vertCos) {
DerivedMesh *tdm = CDDM_copy(dm);
dm->release(dm);
dm = tdm;
CDDM_apply_vert_coords(dm, vertCos);
CDDM_calc_normals(dm);
}
} else {
if (vertCos) {
displist_apply_allverts(dispbase, vertCos);
}
if (ELEM(ob->type, OB_CURVE, OB_FONT) && (cu->flag & CU_DEFORM_FILL)) {
curve_to_filledpoly(cu, nurb, dispbase);
}
dm= CDDM_from_curve_customDB(ob, dispbase);
CDDM_calc_normals(dm);
}
if (vertCos) {
/* Vertex coordinates were applied to necessary data, could free it */
MEM_freeN(vertCos);
vertCos= NULL;
}
ndm = mti->applyModifier(md, ob, dm, forRender, editmode);
if (ndm) {
/* Modifier returned a new derived mesh */
if (dm && dm != ndm) /* Modifier */
dm->release (dm);
dm = ndm;
}
}
}
//.........这里部分代码省略.........
示例9: curve_calc_modifiers_pre
static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, float (**originalVerts_r)[3], float (**deformedVerts_r)[3], int *numVerts_r)
{
ModifierData *md = modifiers_getVirtualModifierList(ob);
ModifierData *preTesselatePoint;
Curve *cu= ob->data;
ListBase *nurb= BKE_curve_nurbs(cu);
int numVerts = 0;
int editmode = (!forRender && cu->editnurb);
float (*originalVerts)[3] = NULL;
float (*deformedVerts)[3] = NULL;
float *keyVerts= NULL;
int required_mode;
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(cu->editnurb==NULL) {
keyVerts= do_ob_key(scene, ob);
if(keyVerts) {
/* split coords from key data, the latter also includes
tilts, which is passed through in the modifier stack.
this is also the reason curves do not use a virtual
shape key modifier yet. */
deformedVerts= curve_getKeyVertexCos(cu, nurb, keyVerts);
originalVerts= MEM_dupallocN(deformedVerts);
}
}
if (preTesselatePoint) {
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_OnlyDeform) continue;
if (!deformedVerts) {
deformedVerts = curve_getVertexCos(cu, nurb, &numVerts);
originalVerts = MEM_dupallocN(deformedVerts);
}
mti->deformVerts(md, ob, NULL, deformedVerts, numVerts, forRender, editmode);
if (md==preTesselatePoint)
break;
}
}
if (deformedVerts)
curve_applyVertexCos(cu, nurb, deformedVerts);
if (keyVerts) /* these are not passed through modifier stack */
curve_applyKeyVertexTilts(cu, nurb, keyVerts);
if(keyVerts)
MEM_freeN(keyVerts);
*originalVerts_r = originalVerts;
*deformedVerts_r = deformedVerts;
*numVerts_r = numVerts;
}