use booleans for modifiers and api callbacks.
This commit is contained in:
@@ -248,7 +248,7 @@ typedef struct ModifierTypeInfo {
|
|||||||
*
|
*
|
||||||
* This function is optional (assumes never disabled if not present).
|
* This function is optional (assumes never disabled if not present).
|
||||||
*/
|
*/
|
||||||
int (*isDisabled)(struct ModifierData *md, int userRenderParams);
|
bool (*isDisabled)(struct ModifierData *md, int userRenderParams);
|
||||||
|
|
||||||
/* Add the appropriate relations to the DEP graph depending on the
|
/* Add the appropriate relations to the DEP graph depending on the
|
||||||
* modifier data.
|
* modifier data.
|
||||||
@@ -263,7 +263,7 @@ typedef struct ModifierTypeInfo {
|
|||||||
*
|
*
|
||||||
* This function is optional (assumes false if not present).
|
* This function is optional (assumes false if not present).
|
||||||
*/
|
*/
|
||||||
int (*dependsOnTime)(struct ModifierData *md);
|
bool (*dependsOnTime)(struct ModifierData *md);
|
||||||
|
|
||||||
|
|
||||||
/* True when a deform modifier uses normals, the requiredDataMask
|
/* True when a deform modifier uses normals, the requiredDataMask
|
||||||
@@ -273,7 +273,7 @@ typedef struct ModifierTypeInfo {
|
|||||||
* this is needed because applying 2 deform modifiers will give the
|
* this is needed because applying 2 deform modifiers will give the
|
||||||
* second modifier bogus normals.
|
* second modifier bogus normals.
|
||||||
* */
|
* */
|
||||||
int (*dependsOnNormals)(struct ModifierData *md);
|
bool (*dependsOnNormals)(struct ModifierData *md);
|
||||||
|
|
||||||
|
|
||||||
/* Should call the given walk function on with a pointer to each Object
|
/* Should call the given walk function on with a pointer to each Object
|
||||||
@@ -318,19 +318,19 @@ void modifier_free(struct ModifierData *md);
|
|||||||
void modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md);
|
void modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md);
|
||||||
|
|
||||||
void modifier_copyData(struct ModifierData *md, struct ModifierData *target);
|
void modifier_copyData(struct ModifierData *md, struct ModifierData *target);
|
||||||
int modifier_dependsOnTime(struct ModifierData *md);
|
bool modifier_dependsOnTime(struct ModifierData *md);
|
||||||
int modifier_supportsMapping(struct ModifierData *md);
|
bool modifier_supportsMapping(struct ModifierData *md);
|
||||||
int modifier_couldBeCage(struct Scene *scene, struct ModifierData *md);
|
bool modifier_couldBeCage(struct Scene *scene, struct ModifierData *md);
|
||||||
int modifier_isCorrectableDeformed(struct ModifierData *md);
|
bool modifier_isCorrectableDeformed(struct ModifierData *md);
|
||||||
int modifier_isSameTopology(ModifierData *md);
|
bool modifier_isSameTopology(ModifierData *md);
|
||||||
int modifier_isNonGeometrical(ModifierData *md);
|
bool modifier_isNonGeometrical(ModifierData *md);
|
||||||
int modifier_isEnabled(struct Scene *scene, struct ModifierData *md, int required_mode);
|
bool modifier_isEnabled(struct Scene *scene, struct ModifierData *md, int required_mode);
|
||||||
void modifier_setError(struct ModifierData *md, const char *format, ...)
|
void modifier_setError(struct ModifierData *md, const char *format, ...)
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
__attribute__ ((format(printf, 2, 3)))
|
__attribute__ ((format(printf, 2, 3)))
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
int modifier_isPreview(struct ModifierData *md);
|
bool modifier_isPreview(struct ModifierData *md);
|
||||||
|
|
||||||
void modifiers_foreachObjectLink(struct Object *ob,
|
void modifiers_foreachObjectLink(struct Object *ob,
|
||||||
ObjectWalkFunc walk,
|
ObjectWalkFunc walk,
|
||||||
@@ -348,18 +348,18 @@ void modifiers_clearErrors(struct Object *ob);
|
|||||||
int modifiers_getCageIndex(struct Scene *scene, struct Object *ob,
|
int modifiers_getCageIndex(struct Scene *scene, struct Object *ob,
|
||||||
int *lastPossibleCageIndex_r, int virtual_);
|
int *lastPossibleCageIndex_r, int virtual_);
|
||||||
|
|
||||||
int modifiers_isModifierEnabled(struct Object *ob, int modifierType);
|
bool modifiers_isModifierEnabled(struct Object *ob, int modifierType);
|
||||||
int modifiers_isSoftbodyEnabled(struct Object *ob);
|
bool modifiers_isSoftbodyEnabled(struct Object *ob);
|
||||||
int modifiers_isClothEnabled(struct Object *ob);
|
bool modifiers_isClothEnabled(struct Object *ob);
|
||||||
int modifiers_isParticleEnabled(struct Object *ob);
|
bool modifiers_isParticleEnabled(struct Object *ob);
|
||||||
|
|
||||||
struct Object *modifiers_isDeformedByArmature(struct Object *ob);
|
struct Object *modifiers_isDeformedByArmature(struct Object *ob);
|
||||||
struct Object *modifiers_isDeformedByLattice(struct Object *ob);
|
struct Object *modifiers_isDeformedByLattice(struct Object *ob);
|
||||||
struct Object *modifiers_isDeformedByCurve(struct Object *ob);
|
struct Object *modifiers_isDeformedByCurve(struct Object *ob);
|
||||||
int modifiers_usesArmature(struct Object *ob, struct bArmature *arm);
|
bool modifiers_usesArmature(struct Object *ob, struct bArmature *arm);
|
||||||
int modifiers_isCorrectableDeformed(struct Object *ob);
|
bool modifiers_isCorrectableDeformed(struct Object *ob);
|
||||||
void modifier_freeTemporaryData(struct ModifierData *md);
|
void modifier_freeTemporaryData(struct ModifierData *md);
|
||||||
int modifiers_isPreview(struct Object *ob);
|
bool modifiers_isPreview(struct Object *ob);
|
||||||
|
|
||||||
typedef struct CDMaskLink {
|
typedef struct CDMaskLink {
|
||||||
struct CDMaskLink *next;
|
struct CDMaskLink *next;
|
||||||
|
@@ -127,7 +127,7 @@ void BKE_free_oceantex(struct OceanTex *ot);
|
|||||||
struct OceanTex *BKE_add_oceantex(void);
|
struct OceanTex *BKE_add_oceantex(void);
|
||||||
struct OceanTex *BKE_copy_oceantex(struct OceanTex *ot);
|
struct OceanTex *BKE_copy_oceantex(struct OceanTex *ot);
|
||||||
|
|
||||||
int BKE_texture_dependsOnTime(const struct Tex *texture);
|
bool BKE_texture_dependsOnTime(const struct Tex *texture);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@@ -127,14 +127,14 @@ void modifier_unique_name(ListBase *modifiers, ModifierData *md)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifier_dependsOnTime(ModifierData *md)
|
bool modifier_dependsOnTime(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
return mti->dependsOnTime && mti->dependsOnTime(md);
|
return mti->dependsOnTime && mti->dependsOnTime(md);
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifier_supportsMapping(ModifierData *md)
|
bool modifier_supportsMapping(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ int modifier_supportsMapping(ModifierData *md)
|
|||||||
(mti->flags & eModifierTypeFlag_SupportsMapping));
|
(mti->flags & eModifierTypeFlag_SupportsMapping));
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifier_isPreview(ModifierData *md)
|
bool modifier_isPreview(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ void modifier_copyData(ModifierData *md, ModifierData *target)
|
|||||||
mti->copyData(md, target);
|
mti->copyData(md, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifier_couldBeCage(struct Scene *scene, ModifierData *md)
|
bool modifier_couldBeCage(struct Scene *scene, ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
@@ -249,13 +249,13 @@ int modifier_couldBeCage(struct Scene *scene, ModifierData *md)
|
|||||||
modifier_supportsMapping(md));
|
modifier_supportsMapping(md));
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifier_isSameTopology(ModifierData *md)
|
bool modifier_isSameTopology(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
return ELEM(mti->type, eModifierTypeType_OnlyDeform, eModifierTypeType_NonGeometrical);
|
return ELEM(mti->type, eModifierTypeType_OnlyDeform, eModifierTypeType_NonGeometrical);
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifier_isNonGeometrical(ModifierData *md)
|
bool modifier_isNonGeometrical(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
return (mti->type == eModifierTypeType_NonGeometrical);
|
return (mti->type == eModifierTypeType_NonGeometrical);
|
||||||
@@ -320,35 +320,35 @@ int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *lastPossibleCag
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int modifiers_isSoftbodyEnabled(Object *ob)
|
bool modifiers_isSoftbodyEnabled(Object *ob)
|
||||||
{
|
{
|
||||||
ModifierData *md = modifiers_findByType(ob, eModifierType_Softbody);
|
ModifierData *md = modifiers_findByType(ob, eModifierType_Softbody);
|
||||||
|
|
||||||
return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render));
|
return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render));
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifiers_isClothEnabled(Object *ob)
|
bool modifiers_isClothEnabled(Object *ob)
|
||||||
{
|
{
|
||||||
ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth);
|
ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth);
|
||||||
|
|
||||||
return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render));
|
return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render));
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifiers_isModifierEnabled(Object *ob, int modifierType)
|
bool modifiers_isModifierEnabled(Object *ob, int modifierType)
|
||||||
{
|
{
|
||||||
ModifierData *md = modifiers_findByType(ob, modifierType);
|
ModifierData *md = modifiers_findByType(ob, modifierType);
|
||||||
|
|
||||||
return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render));
|
return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render));
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifiers_isParticleEnabled(Object *ob)
|
bool modifiers_isParticleEnabled(Object *ob)
|
||||||
{
|
{
|
||||||
ModifierData *md = modifiers_findByType(ob, eModifierType_ParticleSystem);
|
ModifierData *md = modifiers_findByType(ob, eModifierType_ParticleSystem);
|
||||||
|
|
||||||
return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render));
|
return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render));
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifier_isEnabled(struct Scene *scene, ModifierData *md, int required_mode)
|
bool modifier_isEnabled(struct Scene *scene, ModifierData *md, int required_mode)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
@@ -569,7 +569,7 @@ Object *modifiers_isDeformedByCurve(Object *ob)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifiers_usesArmature(Object *ob, bArmature *arm)
|
bool modifiers_usesArmature(Object *ob, bArmature *arm)
|
||||||
{
|
{
|
||||||
ModifierData *md = modifiers_getVirtualModifierList(ob);
|
ModifierData *md = modifiers_getVirtualModifierList(ob);
|
||||||
|
|
||||||
@@ -577,24 +577,24 @@ int modifiers_usesArmature(Object *ob, bArmature *arm)
|
|||||||
if (md->type == eModifierType_Armature) {
|
if (md->type == eModifierType_Armature) {
|
||||||
ArmatureModifierData *amd = (ArmatureModifierData *) md;
|
ArmatureModifierData *amd = (ArmatureModifierData *) md;
|
||||||
if (amd->object && amd->object->data == arm)
|
if (amd->object && amd->object->data == arm)
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifier_isCorrectableDeformed(ModifierData *md)
|
bool modifier_isCorrectableDeformed(ModifierData *md)
|
||||||
{
|
{
|
||||||
if (md->type == eModifierType_Armature)
|
if (md->type == eModifierType_Armature)
|
||||||
return 1;
|
return true;
|
||||||
if (md->type == eModifierType_ShapeKey)
|
if (md->type == eModifierType_ShapeKey)
|
||||||
return 1;
|
return true;
|
||||||
|
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifiers_isCorrectableDeformed(Object *ob)
|
bool modifiers_isCorrectableDeformed(Object *ob)
|
||||||
{
|
{
|
||||||
ModifierData *md = modifiers_getVirtualModifierList(ob);
|
ModifierData *md = modifiers_getVirtualModifierList(ob);
|
||||||
|
|
||||||
@@ -603,24 +603,24 @@ int modifiers_isCorrectableDeformed(Object *ob)
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
else if (modifier_isCorrectableDeformed(md)) {
|
else if (modifier_isCorrectableDeformed(md)) {
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether the given object has a modifier in its stack that uses WEIGHT_MCOL CD layer
|
/* Check whether the given object has a modifier in its stack that uses WEIGHT_MCOL CD layer
|
||||||
* to preview something... Used by DynamicPaint and WeightVG currently. */
|
* to preview something... Used by DynamicPaint and WeightVG currently. */
|
||||||
int modifiers_isPreview(Object *ob)
|
bool modifiers_isPreview(Object *ob)
|
||||||
{
|
{
|
||||||
ModifierData *md = ob->modifiers.first;
|
ModifierData *md = ob->modifiers.first;
|
||||||
|
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
if (modifier_isPreview(md))
|
if (modifier_isPreview(md))
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void modifier_freeTemporaryData(ModifierData *md)
|
void modifier_freeTemporaryData(ModifierData *md)
|
||||||
|
@@ -1420,10 +1420,10 @@ void BKE_free_oceantex(struct OceanTex *ot)
|
|||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
int BKE_texture_dependsOnTime(const struct Tex *texture)
|
bool BKE_texture_dependsOnTime(const struct Tex *texture)
|
||||||
{
|
{
|
||||||
if (texture->ima &&
|
if (texture->ima &&
|
||||||
ELEM(texture->ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE))
|
ELEM(texture->ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -82,7 +82,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
ArmatureModifierData *amd = (ArmatureModifierData *) md;
|
ArmatureModifierData *amd = (ArmatureModifierData *) md;
|
||||||
|
|
||||||
|
@@ -59,7 +59,7 @@ static void copyData(ModifierData *md, ModifierData *target)
|
|||||||
tbmd->operation = bmd->operation;
|
tbmd->operation = bmd->operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
BooleanModifierData *bmd = (BooleanModifierData *) md;
|
BooleanModifierData *bmd = (BooleanModifierData *) md;
|
||||||
|
|
||||||
|
@@ -71,9 +71,9 @@ static void copyData(ModifierData *md, ModifierData *target)
|
|||||||
tbmd->seed = bmd->seed;
|
tbmd->seed = bmd->seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
static bool dependsOnTime(ModifierData *UNUSED(md))
|
||||||
{
|
{
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
|
static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
|
||||||
|
@@ -78,16 +78,16 @@ static void copyData(ModifierData *md, ModifierData *target)
|
|||||||
BLI_strncpy(tcmd->defgrp_name, cmd->defgrp_name, sizeof(tcmd->defgrp_name));
|
BLI_strncpy(tcmd->defgrp_name, cmd->defgrp_name, sizeof(tcmd->defgrp_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
CastModifierData *cmd = (CastModifierData *) md;
|
CastModifierData *cmd = (CastModifierData *) md;
|
||||||
short flag;
|
short flag;
|
||||||
|
|
||||||
flag = cmd->flag & (MOD_CAST_X | MOD_CAST_Y | MOD_CAST_Z);
|
flag = cmd->flag & (MOD_CAST_X | MOD_CAST_Y | MOD_CAST_Z);
|
||||||
|
|
||||||
if ((cmd->fac == 0.0f) || flag == 0) return 1;
|
if ((cmd->fac == 0.0f) || flag == 0) return true;
|
||||||
|
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
||||||
|
@@ -159,9 +159,9 @@ static void copyData(ModifierData *md, ModifierData *target)
|
|||||||
tclmd->clothObject = NULL;
|
tclmd->clothObject = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
static bool dependsOnTime(ModifierData *UNUSED(md))
|
||||||
{
|
{
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void freeData(ModifierData *md)
|
static void freeData(ModifierData *md)
|
||||||
|
@@ -99,9 +99,9 @@ static void freeData(ModifierData *md)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
static bool dependsOnTime(ModifierData *UNUSED(md))
|
||||||
{
|
{
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, Object *ob,
|
static void deformVerts(ModifierData *md, Object *ob,
|
||||||
|
@@ -78,7 +78,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(userRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(userRenderParams))
|
||||||
{
|
{
|
||||||
CurveModifierData *cmd = (CurveModifierData *) md;
|
CurveModifierData *cmd = (CurveModifierData *) md;
|
||||||
|
|
||||||
|
@@ -95,7 +95,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *md)
|
static bool dependsOnTime(ModifierData *md)
|
||||||
{
|
{
|
||||||
DisplaceModifierData *dmd = (DisplaceModifierData *)md;
|
DisplaceModifierData *dmd = (DisplaceModifierData *)md;
|
||||||
|
|
||||||
@@ -103,11 +103,11 @@ static int dependsOnTime(ModifierData *md)
|
|||||||
return BKE_texture_dependsOnTime(dmd->texture);
|
return BKE_texture_dependsOnTime(dmd->texture);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnNormals(ModifierData *md)
|
static bool dependsOnNormals(ModifierData *md)
|
||||||
{
|
{
|
||||||
DisplaceModifierData *dmd = (DisplaceModifierData *)md;
|
DisplaceModifierData *dmd = (DisplaceModifierData *)md;
|
||||||
return (dmd->direction == MOD_DISP_DIR_NOR);
|
return (dmd->direction == MOD_DISP_DIR_NOR);
|
||||||
@@ -137,7 +137,7 @@ static void foreachTexLink(ModifierData *md, Object *ob,
|
|||||||
walk(userData, ob, md, "texture");
|
walk(userData, ob, md, "texture");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
DisplaceModifierData *dmd = (DisplaceModifierData *) md;
|
DisplaceModifierData *dmd = (DisplaceModifierData *) md;
|
||||||
return ((!dmd->texture && dmd->direction == MOD_DISP_DIR_RGB_XYZ) || dmd->strength == 0.0f);
|
return ((!dmd->texture && dmd->direction == MOD_DISP_DIR_RGB_XYZ) || dmd->strength == 0.0f);
|
||||||
|
@@ -139,9 +139,9 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
static bool dependsOnTime(ModifierData *UNUSED(md))
|
||||||
{
|
{
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachIDLink(ModifierData *md, Object *ob,
|
static void foreachIDLink(ModifierData *md, Object *ob,
|
||||||
|
@@ -80,9 +80,9 @@ static void copyData(ModifierData *md, ModifierData *target)
|
|||||||
temd->protect = emd->protect;
|
temd->protect = emd->protect;
|
||||||
temd->vgroup = emd->vgroup;
|
temd->vgroup = emd->vgroup;
|
||||||
}
|
}
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
static bool dependsOnTime(ModifierData *UNUSED(md))
|
||||||
{
|
{
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
||||||
{
|
{
|
||||||
|
@@ -123,9 +123,9 @@ static void updateDepgraph(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
static bool dependsOnTime(ModifierData *UNUSED(md))
|
||||||
{
|
{
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -94,7 +94,7 @@ static void freeData(ModifierData *md)
|
|||||||
if (hmd->indexar) MEM_freeN(hmd->indexar);
|
if (hmd->indexar) MEM_freeN(hmd->indexar);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
HookModifierData *hmd = (HookModifierData *) md;
|
HookModifierData *hmd = (HookModifierData *) md;
|
||||||
|
|
||||||
|
@@ -80,8 +80,8 @@ struct BLaplacianSystem {
|
|||||||
};
|
};
|
||||||
typedef struct BLaplacianSystem LaplacianSystem;
|
typedef struct BLaplacianSystem LaplacianSystem;
|
||||||
|
|
||||||
static CustomDataMask required_data_mask(Object *UNUSED(ob), ModifierData *md);
|
static CustomDataMask required_data_mask(Object *ob, ModifierData *md);
|
||||||
static int is_disabled(ModifierData *md, int UNUSED(useRenderParams));
|
static bool is_disabled(ModifierData *md, int useRenderParams);
|
||||||
static float average_area_quad_v3(float *v1, float *v2, float *v3, float *v4);
|
static float average_area_quad_v3(float *v1, float *v2, float *v3, float *v4);
|
||||||
static float compute_volume(float (*vertexCos)[3], MFace *mfaces, int numFaces);
|
static float compute_volume(float (*vertexCos)[3], MFace *mfaces, int numFaces);
|
||||||
static float cotan_weight(float *v1, float *v2, float *v3);
|
static float cotan_weight(float *v1, float *v2, float *v3);
|
||||||
@@ -215,7 +215,7 @@ static void copy_data(ModifierData *md, ModifierData *target)
|
|||||||
BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, sizeof(tsmd->defgrp_name));
|
BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, sizeof(tsmd->defgrp_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int is_disabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool is_disabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *) md;
|
LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *) md;
|
||||||
short flag;
|
short flag;
|
||||||
|
@@ -74,7 +74,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(userRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(userRenderParams))
|
||||||
{
|
{
|
||||||
LatticeModifierData *lmd = (LatticeModifierData *) md;
|
LatticeModifierData *lmd = (LatticeModifierData *) md;
|
||||||
|
|
||||||
|
@@ -96,13 +96,13 @@ static void copyData(ModifierData *md, ModifierData *target)
|
|||||||
BLI_strncpy(tmcmd->filepath, mcmd->filepath, sizeof(tmcmd->filepath));
|
BLI_strncpy(tmcmd->filepath, mcmd->filepath, sizeof(tmcmd->filepath));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *md)
|
static bool dependsOnTime(ModifierData *md)
|
||||||
{
|
{
|
||||||
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
|
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
|
||||||
return (mcmd->play_mode == MOD_MESHCACHE_PLAY_CFEA);
|
return (mcmd->play_mode == MOD_MESHCACHE_PLAY_CFEA);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
MeshCacheModifierData *mcmd = (MeshCacheModifierData *) md;
|
MeshCacheModifierData *mcmd = (MeshCacheModifierData *) md;
|
||||||
|
|
||||||
|
@@ -96,7 +96,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
MeshDeformModifierData *mmd = (MeshDeformModifierData *) md;
|
MeshDeformModifierData *mmd = (MeshDeformModifierData *) md;
|
||||||
|
|
||||||
|
@@ -43,9 +43,9 @@
|
|||||||
* no other functions will be called
|
* no other functions will be called
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int isDisabled(ModifierData *UNUSED(md), int UNUSED(userRenderParams))
|
static bool isDisabled(ModifierData *UNUSED(md), int UNUSED(userRenderParams))
|
||||||
{
|
{
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModifierTypeInfo modifierType_None = {
|
ModifierTypeInfo modifierType_None = {
|
||||||
|
@@ -77,12 +77,7 @@ static void copyData(ModifierData *md, ModifierData *target)
|
|||||||
tpimd->random_position = pimd->random_position;
|
tpimd->random_position = pimd->random_position;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
static bool isDisabled(ModifierData *md, int useRenderParams)
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int useRenderParams)
|
|
||||||
{
|
{
|
||||||
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *)md;
|
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *)md;
|
||||||
ParticleSystem *psys;
|
ParticleSystem *psys;
|
||||||
@@ -417,7 +412,7 @@ ModifierTypeInfo modifierType_ParticleInstance = {
|
|||||||
/* freeData */ NULL,
|
/* freeData */ NULL,
|
||||||
/* isDisabled */ isDisabled,
|
/* isDisabled */ isDisabled,
|
||||||
/* updateDepgraph */ updateDepgraph,
|
/* updateDepgraph */ updateDepgraph,
|
||||||
/* dependsOnTime */ dependsOnTime,
|
/* dependsOnTime */ NULL,
|
||||||
/* dependsOnNormals */ NULL,
|
/* dependsOnNormals */ NULL,
|
||||||
/* foreachObjectLink */ foreachObjectLink,
|
/* foreachObjectLink */ foreachObjectLink,
|
||||||
/* foreachIDLink */ NULL,
|
/* foreachIDLink */ NULL,
|
||||||
|
@@ -930,12 +930,6 @@ static void foreachObjectLink(
|
|||||||
walk(userData, ob, <md->ob_axis);
|
walk(userData, ob, <md->ob_axis);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ModifierTypeInfo modifierType_Screw = {
|
ModifierTypeInfo modifierType_Screw = {
|
||||||
/* name */ "Screw",
|
/* name */ "Screw",
|
||||||
/* structName */ "ScrewModifierData",
|
/* structName */ "ScrewModifierData",
|
||||||
@@ -959,7 +953,7 @@ ModifierTypeInfo modifierType_Screw = {
|
|||||||
/* freeData */ NULL,
|
/* freeData */ NULL,
|
||||||
/* isDisabled */ NULL,
|
/* isDisabled */ NULL,
|
||||||
/* updateDepgraph */ updateDepgraph,
|
/* updateDepgraph */ updateDepgraph,
|
||||||
/* dependsOnTime */ dependsOnTime,
|
/* dependsOnTime */ NULL,
|
||||||
/* dependsOnNormals */ NULL,
|
/* dependsOnNormals */ NULL,
|
||||||
/* foreachObjectLink */ foreachObjectLink,
|
/* foreachObjectLink */ foreachObjectLink,
|
||||||
/* foreachIDLink */ NULL,
|
/* foreachIDLink */ NULL,
|
||||||
|
@@ -95,7 +95,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *) md;
|
ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *) md;
|
||||||
return !smd->target;
|
return !smd->target;
|
||||||
@@ -161,7 +161,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
|
|||||||
DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier");
|
DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnNormals(ModifierData *md)
|
static bool dependsOnNormals(ModifierData *md)
|
||||||
{
|
{
|
||||||
ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md;
|
ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md;
|
||||||
|
|
||||||
|
@@ -108,9 +108,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
return smokeModifier_do(smd, md->scene, ob, dm);
|
return smokeModifier_do(smd, md->scene, ob, dm);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
static bool dependsOnTime(ModifierData *UNUSED(md))
|
||||||
{
|
{
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void updateDepgraph(ModifierData *md, DagForest *forest,
|
static void updateDepgraph(ModifierData *md, DagForest *forest,
|
||||||
|
@@ -70,7 +70,7 @@ static void copyData(ModifierData *md, ModifierData *target)
|
|||||||
BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, sizeof(tsmd->defgrp_name));
|
BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, sizeof(tsmd->defgrp_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
SmoothModifierData *smd = (SmoothModifierData *) md;
|
SmoothModifierData *smd = (SmoothModifierData *) md;
|
||||||
short flag;
|
short flag;
|
||||||
|
@@ -53,9 +53,9 @@ static void deformVerts(ModifierData *md, Object *ob,
|
|||||||
sbObjectStep(md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts);
|
sbObjectStep(md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
static bool dependsOnTime(ModifierData *UNUSED(md))
|
||||||
{
|
{
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -81,7 +81,7 @@ static void freeData(ModifierData *md)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int useRenderParams)
|
static bool isDisabled(ModifierData *md, int useRenderParams)
|
||||||
{
|
{
|
||||||
SubsurfModifierData *smd = (SubsurfModifierData *) md;
|
SubsurfModifierData *smd = (SubsurfModifierData *) md;
|
||||||
int levels = (useRenderParams) ? smd->renderLevels : smd->levels;
|
int levels = (useRenderParams) ? smd->renderLevels : smd->levels;
|
||||||
|
@@ -80,9 +80,9 @@ static void freeData(ModifierData *md)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
static bool dependsOnTime(ModifierData *UNUSED(md))
|
||||||
{
|
{
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, Object *ob,
|
static void deformVerts(ModifierData *md, Object *ob,
|
||||||
|
@@ -97,7 +97,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *md)
|
static bool dependsOnTime(ModifierData *md)
|
||||||
{
|
{
|
||||||
WarpModifierData *wmd = (WarpModifierData *)md;
|
WarpModifierData *wmd = (WarpModifierData *)md;
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ static int dependsOnTime(ModifierData *md)
|
|||||||
return BKE_texture_dependsOnTime(wmd->texture);
|
return BKE_texture_dependsOnTime(wmd->texture);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ static void freeData(ModifierData *md)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(userRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(userRenderParams))
|
||||||
{
|
{
|
||||||
WarpModifierData *wmd = (WarpModifierData *) md;
|
WarpModifierData *wmd = (WarpModifierData *) md;
|
||||||
|
|
||||||
|
@@ -100,9 +100,9 @@ static void copyData(ModifierData *md, ModifierData *target)
|
|||||||
BLI_strncpy(twmd->defgrp_name, wmd->defgrp_name, sizeof(twmd->defgrp_name));
|
BLI_strncpy(twmd->defgrp_name, wmd->defgrp_name, sizeof(twmd->defgrp_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *UNUSED(md))
|
static bool dependsOnTime(ModifierData *UNUSED(md))
|
||||||
{
|
{
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachObjectLink(
|
static void foreachObjectLink(
|
||||||
|
@@ -121,13 +121,13 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *md)
|
static bool dependsOnTime(ModifierData *md)
|
||||||
{
|
{
|
||||||
WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md;
|
WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md;
|
||||||
|
|
||||||
if (wmd->mask_texture)
|
if (wmd->mask_texture)
|
||||||
return BKE_texture_dependsOnTime(wmd->mask_texture);
|
return BKE_texture_dependsOnTime(wmd->mask_texture);
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachObjectLink(ModifierData *md, Object *ob,
|
static void foreachObjectLink(ModifierData *md, Object *ob,
|
||||||
@@ -170,7 +170,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *UN
|
|||||||
"WeightVGEdit Modifier");
|
"WeightVGEdit Modifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md;
|
WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md;
|
||||||
/* If no vertex group, bypass. */
|
/* If no vertex group, bypass. */
|
||||||
|
@@ -161,13 +161,13 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *md)
|
static bool dependsOnTime(ModifierData *md)
|
||||||
{
|
{
|
||||||
WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md;
|
WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md;
|
||||||
|
|
||||||
if (wmd->mask_texture)
|
if (wmd->mask_texture)
|
||||||
return BKE_texture_dependsOnTime(wmd->mask_texture);
|
return BKE_texture_dependsOnTime(wmd->mask_texture);
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachObjectLink(ModifierData *md, Object *ob,
|
static void foreachObjectLink(ModifierData *md, Object *ob,
|
||||||
@@ -210,7 +210,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *UN
|
|||||||
"WeightVGMix Modifier");
|
"WeightVGMix Modifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md;
|
WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md;
|
||||||
/* If no vertex group, bypass. */
|
/* If no vertex group, bypass. */
|
||||||
|
@@ -282,7 +282,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dependsOnTime(ModifierData *md)
|
static bool dependsOnTime(ModifierData *md)
|
||||||
{
|
{
|
||||||
WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
|
WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *UN
|
|||||||
"WeightVGProximity Modifier");
|
"WeightVGProximity Modifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
|
WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
|
||||||
/* If no vertex group, bypass. */
|
/* If no vertex group, bypass. */
|
||||||
|
Reference in New Issue
Block a user