Merge branch 'master' into blender2.8
This commit is contained in:
@@ -358,7 +358,7 @@ if(WITH_LLVM)
|
|||||||
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
|
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
|
||||||
OUTPUT_VARIABLE LLVM_LIBRARY
|
OUTPUT_VARIABLE LLVM_LIBRARY
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
|
string(REPLACE ".a /" ".a;/" LLVM_LIBRARY ${LLVM_LIBRARY})
|
||||||
else()
|
else()
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
|
||||||
endif()
|
endif()
|
||||||
@@ -418,7 +418,7 @@ if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
|
|||||||
endif()
|
endif()
|
||||||
# Get rid of eventually clashes, we export some symbols explicite as local
|
# Get rid of eventually clashes, we export some symbols explicite as local
|
||||||
set(PLATFORM_LINKFLAGS
|
set(PLATFORM_LINKFLAGS
|
||||||
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker ${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map"
|
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker '${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||||
|
@@ -111,10 +111,11 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
|
|||||||
DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Armature Modifier");
|
DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Armature Modifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
Mesh *mesh,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
Mesh *mesh,
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
ArmatureModifierData *amd = (ArmatureModifierData *) md;
|
ArmatureModifierData *amd = (ArmatureModifierData *) md;
|
||||||
|
|
||||||
@@ -169,8 +170,9 @@ static void deformMatricesEM(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformMatrices(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh,
|
static void deformMatrices(
|
||||||
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts)
|
ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts)
|
||||||
{
|
{
|
||||||
ArmatureModifierData *amd = (ArmatureModifierData *) md;
|
ArmatureModifierData *amd = (ArmatureModifierData *) md;
|
||||||
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
||||||
|
@@ -742,8 +742,9 @@ static Mesh *arrayModifier_doArray(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static Mesh *applyModifier(
|
||||||
Mesh *mesh)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
Mesh *mesh)
|
||||||
{
|
{
|
||||||
ArrayModifierData *amd = (ArrayModifierData *) md;
|
ArrayModifierData *amd = (ArrayModifierData *) md;
|
||||||
return arrayModifier_doArray(amd, ctx, mesh);
|
return arrayModifier_doArray(amd, ctx, mesh);
|
||||||
|
@@ -65,8 +65,9 @@ static bool dependsOnTime(ModifierData *UNUSED(md))
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static Mesh *applyModifier(
|
||||||
struct Mesh *mesh)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
struct Mesh *mesh)
|
||||||
{
|
{
|
||||||
Mesh *result;
|
Mesh *result;
|
||||||
BuildModifierData *bmd = (BuildModifierData *) md;
|
BuildModifierData *bmd = (BuildModifierData *) md;
|
||||||
|
@@ -422,10 +422,11 @@ static void cuboid_do(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
Mesh *mesh,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
Mesh *mesh,
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
CastModifierData *cmd = (CastModifierData *)md;
|
CastModifierData *cmd = (CastModifierData *)md;
|
||||||
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
||||||
|
@@ -69,9 +69,10 @@ static void initData(ModifierData *md)
|
|||||||
cloth_init(clmd);
|
cloth_init(clmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
DerivedMesh *derivedData, float (*vertexCos)[3],
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
int numVerts)
|
DerivedMesh *derivedData, float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
DerivedMesh *dm;
|
DerivedMesh *dm;
|
||||||
ClothModifierData *clmd = (ClothModifierData *) md;
|
ClothModifierData *clmd = (ClothModifierData *) md;
|
||||||
@@ -202,8 +203,9 @@ static void freeData(ModifierData *md)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachIDLink(ModifierData *md, Object *ob,
|
static void foreachIDLink(
|
||||||
IDWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
IDWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
ClothModifierData *clmd = (ClothModifierData *) md;
|
ClothModifierData *clmd = (ClothModifierData *) md;
|
||||||
|
|
||||||
|
@@ -95,10 +95,11 @@ static bool dependsOnTime(ModifierData *UNUSED(md))
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
DerivedMesh *derivedData,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
DerivedMesh *derivedData,
|
||||||
int UNUSED(numVerts))
|
float (*vertexCos)[3],
|
||||||
|
int UNUSED(numVerts))
|
||||||
{
|
{
|
||||||
CollisionModifierData *collmd = (CollisionModifierData *) md;
|
CollisionModifierData *collmd = (CollisionModifierData *) md;
|
||||||
DerivedMesh *dm = NULL;
|
DerivedMesh *dm = NULL;
|
||||||
|
@@ -706,7 +706,8 @@ static void correctivesmooth_modifier_do(
|
|||||||
|
|
||||||
/* when the modifier fails to execute */
|
/* when the modifier fails to execute */
|
||||||
error:
|
error:
|
||||||
MEM_SAFE_FREE(csmd->delta_cache);
|
MEM_SAFE_FREE(
|
||||||
|
csmd->delta_cache);
|
||||||
csmd->delta_cache_num = 0;
|
csmd->delta_cache_num = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -79,8 +79,9 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static Mesh *applyModifier(
|
||||||
Mesh *meshData)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
Mesh *meshData)
|
||||||
{
|
{
|
||||||
DecimateModifierData *dmd = (DecimateModifierData *) md;
|
DecimateModifierData *dmd = (DecimateModifierData *) md;
|
||||||
Mesh *mesh = meshData, *result = NULL;
|
Mesh *mesh = meshData, *result = NULL;
|
||||||
|
@@ -108,16 +108,18 @@ static bool dependsOnNormals(ModifierData *md)
|
|||||||
return ELEM(dmd->direction, MOD_DISP_DIR_NOR, MOD_DISP_DIR_CLNOR);
|
return ELEM(dmd->direction, MOD_DISP_DIR_NOR, MOD_DISP_DIR_CLNOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachObjectLink(ModifierData *md, Object *ob,
|
static void foreachObjectLink(
|
||||||
ObjectWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
ObjectWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
DisplaceModifierData *dmd = (DisplaceModifierData *) md;
|
DisplaceModifierData *dmd = (DisplaceModifierData *) md;
|
||||||
|
|
||||||
walk(userData, ob, &dmd->map_object, IDWALK_CB_NOP);
|
walk(userData, ob, &dmd->map_object, IDWALK_CB_NOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachIDLink(ModifierData *md, Object *ob,
|
static void foreachIDLink(
|
||||||
IDWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
IDWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
DisplaceModifierData *dmd = (DisplaceModifierData *) md;
|
DisplaceModifierData *dmd = (DisplaceModifierData *) md;
|
||||||
|
|
||||||
@@ -126,8 +128,9 @@ static void foreachIDLink(ModifierData *md, Object *ob,
|
|||||||
foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData);
|
foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachTexLink(ModifierData *md, Object *ob,
|
static void foreachTexLink(
|
||||||
TexWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
TexWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
walk(userData, ob, md, "texture");
|
walk(userData, ob, md, "texture");
|
||||||
}
|
}
|
||||||
|
@@ -99,8 +99,9 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static DerivedMesh *applyModifier(
|
||||||
DerivedMesh *dm)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
DerivedMesh *dm)
|
||||||
{
|
{
|
||||||
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md;
|
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md;
|
||||||
|
|
||||||
@@ -137,8 +138,9 @@ static bool dependsOnTime(ModifierData *UNUSED(md))
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachIDLink(ModifierData *md, Object *ob,
|
static void foreachIDLink(
|
||||||
IDWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
IDWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md;
|
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md;
|
||||||
|
|
||||||
@@ -155,8 +157,9 @@ static void foreachIDLink(ModifierData *md, Object *ob,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachTexLink(ModifierData *UNUSED(md), Object *UNUSED(ob),
|
static void foreachTexLink(
|
||||||
TexWalkFunc UNUSED(walk), void *UNUSED(userData))
|
ModifierData *UNUSED(md), Object *UNUSED(ob),
|
||||||
|
TexWalkFunc UNUSED(walk), void *UNUSED(userData))
|
||||||
{
|
{
|
||||||
//walk(userData, ob, md, ""); /* re-enable when possible */
|
//walk(userData, ob, md, ""); /* re-enable when possible */
|
||||||
}
|
}
|
||||||
|
@@ -124,9 +124,10 @@ static void initData(ModifierData *md)
|
|||||||
emd->flags = MOD_EDGESPLIT_FROMANGLE | MOD_EDGESPLIT_FROMFLAG;
|
emd->flags = MOD_EDGESPLIT_FROMANGLE | MOD_EDGESPLIT_FROMFLAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Mesh *applyModifier(ModifierData *md,
|
static Mesh *applyModifier(
|
||||||
const ModifierEvalContext *ctx,
|
ModifierData *md,
|
||||||
Mesh *mesh)
|
const ModifierEvalContext *ctx,
|
||||||
|
Mesh *mesh)
|
||||||
{
|
{
|
||||||
Mesh *result;
|
Mesh *result;
|
||||||
EdgeSplitModifierData *emd = (EdgeSplitModifierData *) md;
|
EdgeSplitModifierData *emd = (EdgeSplitModifierData *) md;
|
||||||
|
@@ -94,9 +94,10 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void createFacepa(ExplodeModifierData *emd,
|
static void createFacepa(
|
||||||
ParticleSystemModifierData *psmd,
|
ExplodeModifierData *emd,
|
||||||
DerivedMesh *dm)
|
ParticleSystemModifierData *psmd,
|
||||||
|
DerivedMesh *dm)
|
||||||
{
|
{
|
||||||
ParticleSystem *psys = psmd->psys;
|
ParticleSystem *psys = psmd->psys;
|
||||||
MFace *fa = NULL, *mface = NULL;
|
MFace *fa = NULL, *mface = NULL;
|
||||||
@@ -995,8 +996,9 @@ static ParticleSystemModifierData *findPrecedingParticlesystem(Object *ob, Modif
|
|||||||
}
|
}
|
||||||
return psmd;
|
return psmd;
|
||||||
}
|
}
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static DerivedMesh *applyModifier(
|
||||||
DerivedMesh *derivedData)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
DerivedMesh *derivedData)
|
||||||
{
|
{
|
||||||
DerivedMesh *dm = derivedData;
|
DerivedMesh *dm = derivedData;
|
||||||
ExplodeModifierData *emd = (ExplodeModifierData *) md;
|
ExplodeModifierData *emd = (ExplodeModifierData *) md;
|
||||||
|
@@ -85,8 +85,9 @@ static void copyData(const ModifierData *md, ModifierData *target)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static DerivedMesh *applyModifier(
|
||||||
DerivedMesh *dm)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
DerivedMesh *dm)
|
||||||
{
|
{
|
||||||
FluidsimModifierData *fluidmd = (FluidsimModifierData *) md;
|
FluidsimModifierData *fluidmd = (FluidsimModifierData *) md;
|
||||||
DerivedMesh *result = NULL;
|
DerivedMesh *result = NULL;
|
||||||
|
@@ -304,8 +304,9 @@ static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_exam
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void fluid_get_bb(MVert *mvert, int totvert, float obmat[4][4],
|
void fluid_get_bb(
|
||||||
/*RET*/ float start[3], /*RET*/ float size[3])
|
MVert *mvert, int totvert, float obmat[4][4],
|
||||||
|
/*RET*/ float start[3], /*RET*/ float size[3])
|
||||||
{
|
{
|
||||||
float bbsx = 0.0, bbsy = 0.0, bbsz = 0.0;
|
float bbsx = 0.0, bbsy = 0.0, bbsz = 0.0;
|
||||||
float bbex = 1.0, bbey = 1.0, bbez = 1.0;
|
float bbex = 1.0, bbey = 1.0, bbez = 1.0;
|
||||||
@@ -425,8 +426,9 @@ static void fluidsim_read_vel_cache(FluidsimModifierData *fluidmd, DerivedMesh *
|
|||||||
gzclose(gzf);
|
gzclose(gzf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm,
|
static DerivedMesh *fluidsim_read_cache(
|
||||||
FluidsimModifierData *fluidmd, int framenr, int useRenderParams)
|
Object *ob, DerivedMesh *orgdm,
|
||||||
|
FluidsimModifierData *fluidmd, int framenr, int useRenderParams)
|
||||||
{
|
{
|
||||||
int curFrame = framenr /* - 1 */ /*scene->r.sfra*/; /* start with 0 at start frame */
|
int curFrame = framenr /* - 1 */ /*scene->r.sfra*/; /* start with 0 at start frame */
|
||||||
/* why start with 0 as start frame?? Animations + time are frozen for frame 0 anyway. (See physics_fluid.c for that. - DG */
|
/* why start with 0 as start frame?? Animations + time are frozen for frame 0 anyway. (See physics_fluid.c for that. - DG */
|
||||||
@@ -509,10 +511,11 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm,
|
|||||||
}
|
}
|
||||||
#endif // WITH_MOD_FLUID
|
#endif // WITH_MOD_FLUID
|
||||||
|
|
||||||
DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene,
|
DerivedMesh *fluidsimModifier_do(
|
||||||
Object *ob,
|
FluidsimModifierData *fluidmd, Scene *scene,
|
||||||
DerivedMesh *dm,
|
Object *ob,
|
||||||
int useRenderParams, int UNUSED(isFinalCalc))
|
DerivedMesh *dm,
|
||||||
|
int useRenderParams, int UNUSED(isFinalCalc))
|
||||||
{
|
{
|
||||||
#ifdef WITH_MOD_FLUID
|
#ifdef WITH_MOD_FLUID
|
||||||
DerivedMesh *result = NULL;
|
DerivedMesh *result = NULL;
|
||||||
|
@@ -42,9 +42,10 @@ struct DerivedMesh;
|
|||||||
void fluidsim_init(struct FluidsimModifierData *fluidmd);
|
void fluidsim_init(struct FluidsimModifierData *fluidmd);
|
||||||
void fluidsim_free(struct FluidsimModifierData *fluidmd);
|
void fluidsim_free(struct FluidsimModifierData *fluidmd);
|
||||||
|
|
||||||
struct DerivedMesh *fluidsimModifier_do(struct FluidsimModifierData *fluidmd,
|
struct DerivedMesh *fluidsimModifier_do(
|
||||||
struct Scene *scene, struct Object *ob, struct DerivedMesh *dm,
|
struct FluidsimModifierData *fluidmd,
|
||||||
int useRenderParams, int isFinalCalc);
|
struct Scene *scene, struct Object *ob, struct DerivedMesh *dm,
|
||||||
|
int useRenderParams, int isFinalCalc);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -251,8 +251,9 @@ static void hook_co_apply(struct HookData_cb *hd, const int j)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts_do(HookModifierData *hmd, Object *ob, Mesh *mesh,
|
static void deformVerts_do(
|
||||||
float (*vertexCos)[3], int numVerts)
|
HookModifierData *hmd, Object *ob, Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
bPoseChannel *pchan = BKE_pose_channel_find_name(hmd->object->pose, hmd->subtarget);
|
bPoseChannel *pchan = BKE_pose_channel_find_name(hmd->object->pose, hmd->subtarget);
|
||||||
float dmat[4][4];
|
float dmat[4][4];
|
||||||
@@ -348,8 +349,9 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, Mesh *mesh,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct Mesh *mesh,
|
static void deformVerts(
|
||||||
float (*vertexCos)[3], int numVerts)
|
struct ModifierData *md, const struct ModifierEvalContext *ctx, struct Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
HookModifierData *hmd = (HookModifierData *)md;
|
HookModifierData *hmd = (HookModifierData *)md;
|
||||||
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
||||||
@@ -361,9 +363,10 @@ static void deformVerts(struct ModifierData *md, const struct ModifierEvalContex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVertsEM(struct ModifierData *md, const struct ModifierEvalContext *ctx,
|
static void deformVertsEM(
|
||||||
struct BMEditMesh *editData,
|
struct ModifierData *md, const struct ModifierEvalContext *ctx,
|
||||||
struct Mesh *mesh, float (*vertexCos)[3], int numVerts)
|
struct BMEditMesh *editData,
|
||||||
|
struct Mesh *mesh, float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
HookModifierData *hmd = (HookModifierData *)md;
|
HookModifierData *hmd = (HookModifierData *)md;
|
||||||
Mesh *mesh_src = get_mesh(ctx->object, editData, mesh, NULL, false, false);
|
Mesh *mesh_src = get_mesh(ctx->object, editData, mesh, NULL, false, false);
|
||||||
|
@@ -514,8 +514,9 @@ static bool isValidVertexGroup(LaplacianDeformModifierData *lmd, Object *ob, Mes
|
|||||||
return (dvert != NULL);
|
return (dvert != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initSystem(LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh,
|
static void initSystem(
|
||||||
float (*vertexCos)[3], int numVerts)
|
LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int defgrp_index;
|
int defgrp_index;
|
||||||
@@ -729,8 +730,9 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh,
|
static void deformVerts(
|
||||||
float (*vertexCos)[3], int numVerts)
|
ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
||||||
|
|
||||||
|
@@ -498,8 +498,9 @@ static CustomDataMask required_data_mask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh,
|
static void deformVerts(
|
||||||
float (*vertexCos)[3], int numVerts)
|
ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
Mesh *mesh_src;
|
Mesh *mesh_src;
|
||||||
|
|
||||||
|
@@ -93,10 +93,11 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
|
|||||||
DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Lattice Modifier");
|
DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Lattice Modifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
struct Mesh *mesh,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
struct Mesh *mesh,
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
LatticeModifierData *lmd = (LatticeModifierData *) md;
|
LatticeModifierData *lmd = (LatticeModifierData *) md;
|
||||||
struct Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
struct Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
||||||
|
@@ -263,10 +263,11 @@ static void meshcache_do(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
DerivedMesh *derivedData,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
DerivedMesh *derivedData,
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
|
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
|
||||||
|
|
||||||
|
@@ -48,9 +48,10 @@ typedef struct MDDHead {
|
|||||||
int verts_tot;
|
int verts_tot;
|
||||||
} MDDHead; /* frames, verts */
|
} MDDHead; /* frames, verts */
|
||||||
|
|
||||||
static bool meshcache_read_mdd_head(FILE *fp, const int verts_tot,
|
static bool meshcache_read_mdd_head(
|
||||||
MDDHead *mdd_head,
|
FILE *fp, const int verts_tot,
|
||||||
const char **err_str)
|
MDDHead *mdd_head,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
if (!fread(mdd_head, sizeof(*mdd_head), 1, fp)) {
|
if (!fread(mdd_head, sizeof(*mdd_head), 1, fp)) {
|
||||||
*err_str = "Missing header";
|
*err_str = "Missing header";
|
||||||
@@ -78,11 +79,12 @@ static bool meshcache_read_mdd_head(FILE *fp, const int verts_tot,
|
|||||||
/**
|
/**
|
||||||
* Gets the index frange and factor
|
* Gets the index frange and factor
|
||||||
*/
|
*/
|
||||||
static bool meshcache_read_mdd_range(FILE *fp,
|
static bool meshcache_read_mdd_range(
|
||||||
const int verts_tot,
|
FILE *fp,
|
||||||
const float frame, const char interp,
|
const int verts_tot,
|
||||||
int r_index_range[2], float *r_factor,
|
const float frame, const char interp,
|
||||||
const char **err_str)
|
int r_index_range[2], float *r_factor,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
MDDHead mdd_head;
|
MDDHead mdd_head;
|
||||||
|
|
||||||
@@ -97,11 +99,12 @@ static bool meshcache_read_mdd_range(FILE *fp,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool meshcache_read_mdd_range_from_time(FILE *fp,
|
static bool meshcache_read_mdd_range_from_time(
|
||||||
const int verts_tot,
|
FILE *fp,
|
||||||
const float time, const float UNUSED(fps),
|
const int verts_tot,
|
||||||
float *r_frame,
|
const float time, const float UNUSED(fps),
|
||||||
const char **err_str)
|
float *r_frame,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
MDDHead mdd_head;
|
MDDHead mdd_head;
|
||||||
int i;
|
int i;
|
||||||
@@ -144,10 +147,11 @@ static bool meshcache_read_mdd_range_from_time(FILE *fp,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MOD_meshcache_read_mdd_index(FILE *fp,
|
bool MOD_meshcache_read_mdd_index(
|
||||||
float (*vertexCos)[3], const int verts_tot,
|
FILE *fp,
|
||||||
const int index, const float factor,
|
float (*vertexCos)[3], const int verts_tot,
|
||||||
const char **err_str)
|
const int index, const float factor,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
MDDHead mdd_head;
|
MDDHead mdd_head;
|
||||||
|
|
||||||
@@ -212,10 +216,11 @@ bool MOD_meshcache_read_mdd_index(FILE *fp,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MOD_meshcache_read_mdd_frame(FILE *fp,
|
bool MOD_meshcache_read_mdd_frame(
|
||||||
float (*vertexCos)[3], const int verts_tot, const char interp,
|
FILE *fp,
|
||||||
const float frame,
|
float (*vertexCos)[3], const int verts_tot, const char interp,
|
||||||
const char **err_str)
|
const float frame,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
int index_range[2];
|
int index_range[2];
|
||||||
float factor;
|
float factor;
|
||||||
@@ -253,10 +258,11 @@ bool MOD_meshcache_read_mdd_frame(FILE *fp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MOD_meshcache_read_mdd_times(const char *filepath,
|
bool MOD_meshcache_read_mdd_times(
|
||||||
float (*vertexCos)[3], const int verts_tot, const char interp,
|
const char *filepath,
|
||||||
const float time, const float fps, const char time_mode,
|
float (*vertexCos)[3], const int verts_tot, const char interp,
|
||||||
const char **err_str)
|
const float time, const float fps, const char time_mode,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
float frame;
|
float frame;
|
||||||
|
|
||||||
|
@@ -52,9 +52,10 @@ typedef struct PC2Head {
|
|||||||
int frame_tot;
|
int frame_tot;
|
||||||
} PC2Head; /* frames, verts */
|
} PC2Head; /* frames, verts */
|
||||||
|
|
||||||
static bool meshcache_read_pc2_head(FILE *fp, const int verts_tot,
|
static bool meshcache_read_pc2_head(
|
||||||
PC2Head *pc2_head,
|
FILE *fp, const int verts_tot,
|
||||||
const char **err_str)
|
PC2Head *pc2_head,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
if (!fread(pc2_head, sizeof(*pc2_head), 1, fp)) {
|
if (!fread(pc2_head, sizeof(*pc2_head), 1, fp)) {
|
||||||
*err_str = "Missing header";
|
*err_str = "Missing header";
|
||||||
@@ -90,11 +91,12 @@ static bool meshcache_read_pc2_head(FILE *fp, const int verts_tot,
|
|||||||
*
|
*
|
||||||
* currently same as for MDD
|
* currently same as for MDD
|
||||||
*/
|
*/
|
||||||
static bool meshcache_read_pc2_range(FILE *fp,
|
static bool meshcache_read_pc2_range(
|
||||||
const int verts_tot,
|
FILE *fp,
|
||||||
const float frame, const char interp,
|
const int verts_tot,
|
||||||
int r_index_range[2], float *r_factor,
|
const float frame, const char interp,
|
||||||
const char **err_str)
|
int r_index_range[2], float *r_factor,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
PC2Head pc2_head;
|
PC2Head pc2_head;
|
||||||
|
|
||||||
@@ -109,11 +111,12 @@ static bool meshcache_read_pc2_range(FILE *fp,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool meshcache_read_pc2_range_from_time(FILE *fp,
|
static bool meshcache_read_pc2_range_from_time(
|
||||||
const int verts_tot,
|
FILE *fp,
|
||||||
const float time, const float fps,
|
const int verts_tot,
|
||||||
float *r_frame,
|
const float time, const float fps,
|
||||||
const char **err_str)
|
float *r_frame,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
PC2Head pc2_head;
|
PC2Head pc2_head;
|
||||||
float frame;
|
float frame;
|
||||||
@@ -135,10 +138,11 @@ static bool meshcache_read_pc2_range_from_time(FILE *fp,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MOD_meshcache_read_pc2_index(FILE *fp,
|
bool MOD_meshcache_read_pc2_index(
|
||||||
float (*vertexCos)[3], const int verts_tot,
|
FILE *fp,
|
||||||
const int index, const float factor,
|
float (*vertexCos)[3], const int verts_tot,
|
||||||
const char **err_str)
|
const int index, const float factor,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
PC2Head pc2_head;
|
PC2Head pc2_head;
|
||||||
|
|
||||||
@@ -188,10 +192,11 @@ bool MOD_meshcache_read_pc2_index(FILE *fp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool MOD_meshcache_read_pc2_frame(FILE *fp,
|
bool MOD_meshcache_read_pc2_frame(
|
||||||
float (*vertexCos)[3], const int verts_tot, const char interp,
|
FILE *fp,
|
||||||
const float frame,
|
float (*vertexCos)[3], const int verts_tot, const char interp,
|
||||||
const char **err_str)
|
const float frame,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
int index_range[2];
|
int index_range[2];
|
||||||
float factor;
|
float factor;
|
||||||
@@ -229,10 +234,11 @@ bool MOD_meshcache_read_pc2_frame(FILE *fp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MOD_meshcache_read_pc2_times(const char *filepath,
|
bool MOD_meshcache_read_pc2_times(
|
||||||
float (*vertexCos)[3], const int verts_tot, const char interp,
|
const char *filepath,
|
||||||
const float time, const float fps, const char time_mode,
|
float (*vertexCos)[3], const int verts_tot, const char interp,
|
||||||
const char **err_str)
|
const float time, const float fps, const char time_mode,
|
||||||
|
const char **err_str)
|
||||||
{
|
{
|
||||||
float frame;
|
float frame;
|
||||||
|
|
||||||
|
@@ -31,9 +31,10 @@
|
|||||||
|
|
||||||
#include "MOD_meshcache_util.h"
|
#include "MOD_meshcache_util.h"
|
||||||
|
|
||||||
void MOD_meshcache_calc_range(const float frame, const char interp,
|
void MOD_meshcache_calc_range(
|
||||||
const int frame_tot,
|
const float frame, const char interp,
|
||||||
int r_index_range[2], float *r_factor)
|
const int frame_tot,
|
||||||
|
int r_index_range[2], float *r_factor)
|
||||||
{
|
{
|
||||||
if (interp == MOD_MESHCACHE_INTERP_NONE) {
|
if (interp == MOD_MESHCACHE_INTERP_NONE) {
|
||||||
r_index_range[0] = r_index_range[1] = max_ii(0, min_ii(frame_tot - 1, round_fl_to_int(frame)));
|
r_index_range[0] = r_index_range[1] = max_ii(0, min_ii(frame_tot - 1, round_fl_to_int(frame)));
|
||||||
|
@@ -29,37 +29,44 @@
|
|||||||
|
|
||||||
|
|
||||||
/* MOD_meshcache_mdd.c */
|
/* MOD_meshcache_mdd.c */
|
||||||
bool MOD_meshcache_read_mdd_index(FILE *fp,
|
bool MOD_meshcache_read_mdd_index(
|
||||||
float (*vertexCos)[3], const int vertex_tot,
|
FILE *fp,
|
||||||
const int index, const float factor,
|
float (*vertexCos)[3], const int vertex_tot,
|
||||||
const char **err_str);
|
const int index, const float factor,
|
||||||
bool MOD_meshcache_read_mdd_frame(FILE *fp,
|
const char **err_str);
|
||||||
float (*vertexCos)[3], const int verts_tot, const char interp,
|
bool MOD_meshcache_read_mdd_frame(
|
||||||
const float frame,
|
FILE *fp,
|
||||||
const char **err_str);
|
float (*vertexCos)[3], const int verts_tot, const char interp,
|
||||||
bool MOD_meshcache_read_mdd_times(const char *filepath,
|
const float frame,
|
||||||
float (*vertexCos)[3], const int verts_tot, const char interp,
|
const char **err_str);
|
||||||
const float time, const float fps, const char time_mode,
|
bool MOD_meshcache_read_mdd_times(
|
||||||
const char **err_str);
|
const char *filepath,
|
||||||
|
float (*vertexCos)[3], const int verts_tot, const char interp,
|
||||||
|
const float time, const float fps, const char time_mode,
|
||||||
|
const char **err_str);
|
||||||
|
|
||||||
/* MOD_meshcache_pc2.c */
|
/* MOD_meshcache_pc2.c */
|
||||||
bool MOD_meshcache_read_pc2_index(FILE *fp,
|
bool MOD_meshcache_read_pc2_index(
|
||||||
float (*vertexCos)[3], const int verts_tot,
|
FILE *fp,
|
||||||
const int index, const float factor,
|
float (*vertexCos)[3], const int verts_tot,
|
||||||
const char **err_str);
|
const int index, const float factor,
|
||||||
bool MOD_meshcache_read_pc2_frame(FILE *fp,
|
const char **err_str);
|
||||||
float (*vertexCos)[3], const int verts_tot, const char interp,
|
bool MOD_meshcache_read_pc2_frame(
|
||||||
const float frame,
|
FILE *fp,
|
||||||
const char **err_str);
|
float (*vertexCos)[3], const int verts_tot, const char interp,
|
||||||
bool MOD_meshcache_read_pc2_times(const char *filepath,
|
const float frame,
|
||||||
float (*vertexCos)[3], const int verts_tot, const char interp,
|
const char **err_str);
|
||||||
const float time, const float fps, const char time_mode,
|
bool MOD_meshcache_read_pc2_times(
|
||||||
const char **err_str);
|
const char *filepath,
|
||||||
|
float (*vertexCos)[3], const int verts_tot, const char interp,
|
||||||
|
const float time, const float fps, const char time_mode,
|
||||||
|
const char **err_str);
|
||||||
|
|
||||||
/* MOD_meshcache_util.c */
|
/* MOD_meshcache_util.c */
|
||||||
void MOD_meshcache_calc_range(const float frame, const char interp,
|
void MOD_meshcache_calc_range(
|
||||||
const int frame_tot,
|
const float frame, const char interp,
|
||||||
int r_index_range[2], float *r_factor);
|
const int frame_tot,
|
||||||
|
int r_index_range[2], float *r_factor);
|
||||||
|
|
||||||
#define FRAME_SNAP_EPS 0.0001f
|
#define FRAME_SNAP_EPS 0.0001f
|
||||||
|
|
||||||
|
@@ -411,10 +411,11 @@ static void meshdeformModifier_do(
|
|||||||
if (free_cagemesh) BKE_id_free(NULL, cagemesh);
|
if (free_cagemesh) BKE_id_free(NULL, cagemesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
Mesh *mesh,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
Mesh *mesh,
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
||||||
|
|
||||||
@@ -427,11 +428,12 @@ static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVertsEM(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVertsEM(
|
||||||
struct BMEditMesh *UNUSED(editData),
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
Mesh *mesh,
|
struct BMEditMesh *UNUSED(editData),
|
||||||
float (*vertexCos)[3],
|
Mesh *mesh,
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
||||||
|
|
||||||
|
@@ -87,8 +87,9 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
|||||||
return (mcmd->cache_file == NULL) || (mcmd->object_path[0] == '\0');
|
return (mcmd->cache_file == NULL) || (mcmd->object_path[0] == '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static DerivedMesh *applyModifier(
|
||||||
DerivedMesh *dm)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
DerivedMesh *dm)
|
||||||
{
|
{
|
||||||
#ifdef WITH_ALEMBIC
|
#ifdef WITH_ALEMBIC
|
||||||
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
|
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
|
||||||
@@ -156,8 +157,9 @@ static bool dependsOnTime(ModifierData *md)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachIDLink(ModifierData *md, Object *ob,
|
static void foreachIDLink(
|
||||||
IDWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
IDWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
|
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
|
||||||
|
|
||||||
|
@@ -78,10 +78,11 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
|
|||||||
DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Mirror Modifier");
|
DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Mirror Modifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
static Mesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
static Mesh *doMirrorOnAxis(
|
||||||
Object *ob,
|
MirrorModifierData *mmd,
|
||||||
const Mesh *mesh,
|
Object *ob,
|
||||||
int axis)
|
const Mesh *mesh,
|
||||||
|
int axis)
|
||||||
{
|
{
|
||||||
const float tolerance_sq = mmd->tolerance * mmd->tolerance;
|
const float tolerance_sq = mmd->tolerance * mmd->tolerance;
|
||||||
const bool do_vtargetmap = (mmd->flag & MOD_MIR_NO_MERGE) == 0;
|
const bool do_vtargetmap = (mmd->flag & MOD_MIR_NO_MERGE) == 0;
|
||||||
@@ -292,8 +293,9 @@ static Mesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Mesh *mirrorModifier__doMirror(MirrorModifierData *mmd,
|
static Mesh *mirrorModifier__doMirror(
|
||||||
Object *ob, Mesh *mesh)
|
MirrorModifierData *mmd,
|
||||||
|
Object *ob, Mesh *mesh)
|
||||||
{
|
{
|
||||||
Mesh *result = mesh;
|
Mesh *result = mesh;
|
||||||
|
|
||||||
@@ -321,8 +323,9 @@ static Mesh *mirrorModifier__doMirror(MirrorModifierData *mmd,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static Mesh *applyModifier(
|
||||||
Mesh *mesh)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
Mesh *mesh)
|
||||||
{
|
{
|
||||||
Mesh *result;
|
Mesh *result;
|
||||||
MirrorModifierData *mmd = (MirrorModifierData *) md;
|
MirrorModifierData *mmd = (MirrorModifierData *) md;
|
||||||
|
@@ -58,8 +58,9 @@ static void initData(ModifierData *md)
|
|||||||
mmd->totlvl = 0;
|
mmd->totlvl = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static DerivedMesh *applyModifier(
|
||||||
DerivedMesh *dm)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
DerivedMesh *dm)
|
||||||
{
|
{
|
||||||
MultiresModifierData *mmd = (MultiresModifierData *)md;
|
MultiresModifierData *mmd = (MultiresModifierData *)md;
|
||||||
DerivedMesh *result;
|
DerivedMesh *result;
|
||||||
|
@@ -403,9 +403,10 @@ static DerivedMesh *generate_ocean_geometry(OceanModifierData *omd)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh *doOcean(ModifierData *md, Object *ob,
|
static DerivedMesh *doOcean(
|
||||||
DerivedMesh *derivedData,
|
ModifierData *md, Object *ob,
|
||||||
int UNUSED(useRenderParams))
|
DerivedMesh *derivedData,
|
||||||
|
int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
OceanModifierData *omd = (OceanModifierData *) md;
|
OceanModifierData *omd = (OceanModifierData *) md;
|
||||||
|
|
||||||
@@ -543,9 +544,10 @@ static DerivedMesh *doOcean(ModifierData *md, Object *ob,
|
|||||||
return dm;
|
return dm;
|
||||||
}
|
}
|
||||||
#else /* WITH_OCEANSIM */
|
#else /* WITH_OCEANSIM */
|
||||||
static DerivedMesh *doOcean(ModifierData *md, Object *UNUSED(ob),
|
static DerivedMesh *doOcean(
|
||||||
DerivedMesh *derivedData,
|
ModifierData *md, Object *UNUSED(ob),
|
||||||
int UNUSED(useRenderParams))
|
DerivedMesh *derivedData,
|
||||||
|
int UNUSED(useRenderParams))
|
||||||
{
|
{
|
||||||
/* unused */
|
/* unused */
|
||||||
(void)md;
|
(void)md;
|
||||||
@@ -553,8 +555,9 @@ static DerivedMesh *doOcean(ModifierData *md, Object *UNUSED(ob),
|
|||||||
}
|
}
|
||||||
#endif /* WITH_OCEANSIM */
|
#endif /* WITH_OCEANSIM */
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static DerivedMesh *applyModifier(
|
||||||
DerivedMesh *derivedData)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
DerivedMesh *derivedData)
|
||||||
{
|
{
|
||||||
DerivedMesh *result;
|
DerivedMesh *result;
|
||||||
|
|
||||||
|
@@ -131,8 +131,9 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachObjectLink(ModifierData *md, Object *ob,
|
static void foreachObjectLink(
|
||||||
ObjectWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
ObjectWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md;
|
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md;
|
||||||
|
|
||||||
@@ -194,8 +195,9 @@ static void store_float_in_vcol(MLoopCol *vcol, float float_value)
|
|||||||
vcol->a = 1.0f;
|
vcol->a = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static DerivedMesh *applyModifier(
|
||||||
DerivedMesh *derivedData)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
DerivedMesh *derivedData)
|
||||||
{
|
{
|
||||||
DerivedMesh *dm = derivedData, *result;
|
DerivedMesh *dm = derivedData, *result;
|
||||||
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md;
|
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md;
|
||||||
|
@@ -99,10 +99,11 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* saves the current emitter state for a particle system and calculates particles */
|
/* saves the current emitter state for a particle system and calculates particles */
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
DerivedMesh *derivedData,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
DerivedMesh *derivedData,
|
||||||
int UNUSED(numVerts))
|
float (*vertexCos)[3],
|
||||||
|
int UNUSED(numVerts))
|
||||||
{
|
{
|
||||||
DerivedMesh *dm = derivedData;
|
DerivedMesh *dm = derivedData;
|
||||||
ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md;
|
ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md;
|
||||||
|
@@ -133,9 +133,10 @@ static void dualcon_add_quad(void *output_v, const int vert_indices[4])
|
|||||||
output->curface++;
|
output->curface++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md,
|
static DerivedMesh *applyModifier(
|
||||||
const ModifierEvalContext *UNUSED(ctx),
|
ModifierData *md,
|
||||||
DerivedMesh *dm)
|
const ModifierEvalContext *UNUSED(ctx),
|
||||||
|
DerivedMesh *dm)
|
||||||
{
|
{
|
||||||
RemeshModifierData *rmd;
|
RemeshModifierData *rmd;
|
||||||
DualConOutput *output;
|
DualConOutput *output;
|
||||||
@@ -193,9 +194,10 @@ static DerivedMesh *applyModifier(ModifierData *md,
|
|||||||
|
|
||||||
#else /* !WITH_MOD_REMESH */
|
#else /* !WITH_MOD_REMESH */
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *UNUSED(md),
|
static DerivedMesh *applyModifier(
|
||||||
const ModifierEvalContext *UNUSED(ctx),
|
ModifierData *UNUSED(md),
|
||||||
DerivedMesh *derivedData)
|
const ModifierEvalContext *UNUSED(ctx),
|
||||||
|
DerivedMesh *derivedData)
|
||||||
{
|
{
|
||||||
return derivedData;
|
return derivedData;
|
||||||
}
|
}
|
||||||
|
@@ -177,8 +177,9 @@ static void initData(ModifierData *md)
|
|||||||
ltmd->merge_dist = 0.01f;
|
ltmd->merge_dist = 0.01f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static Mesh *applyModifier(
|
||||||
Mesh *meshData)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
Mesh *meshData)
|
||||||
{
|
{
|
||||||
Mesh *mesh = meshData;
|
Mesh *mesh = meshData;
|
||||||
Mesh *result;
|
Mesh *result;
|
||||||
|
@@ -44,10 +44,11 @@
|
|||||||
|
|
||||||
#include "MOD_modifiertypes.h"
|
#include "MOD_modifiertypes.h"
|
||||||
|
|
||||||
static void deformVerts(ModifierData *UNUSED(md), const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
DerivedMesh *UNUSED(derivedData),
|
ModifierData *UNUSED(md), const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
DerivedMesh *UNUSED(derivedData),
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
Key *key = BKE_key_from_object(ctx->object);
|
Key *key = BKE_key_from_object(ctx->object);
|
||||||
|
|
||||||
@@ -60,8 +61,9 @@ static void deformVerts(ModifierData *UNUSED(md), const ModifierEvalContext *ctx
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformMatrices(ModifierData *md, const ModifierEvalContext *ctx, DerivedMesh *derivedData,
|
static void deformMatrices(
|
||||||
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts)
|
ModifierData *md, const ModifierEvalContext *ctx, DerivedMesh *derivedData,
|
||||||
|
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts)
|
||||||
{
|
{
|
||||||
Key *key = BKE_key_from_object(ctx->object);
|
Key *key = BKE_key_from_object(ctx->object);
|
||||||
KeyBlock *kb = BKE_keyblock_from_object(ctx->object);
|
KeyBlock *kb = BKE_keyblock_from_object(ctx->object);
|
||||||
@@ -82,11 +84,12 @@ static void deformMatrices(ModifierData *md, const ModifierEvalContext *ctx, Der
|
|||||||
deformVerts(md, ctx, derivedData, vertexCos, numVerts);
|
deformVerts(md, ctx, derivedData, vertexCos, numVerts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVertsEM(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVertsEM(
|
||||||
struct BMEditMesh *UNUSED(editData),
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
DerivedMesh *derivedData,
|
struct BMEditMesh *UNUSED(editData),
|
||||||
float (*vertexCos)[3],
|
DerivedMesh *derivedData,
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
Key *key = BKE_key_from_object(ctx->object);
|
Key *key = BKE_key_from_object(ctx->object);
|
||||||
|
|
||||||
@@ -94,12 +97,13 @@ static void deformVertsEM(ModifierData *md, const ModifierEvalContext *ctx,
|
|||||||
deformVerts(md, ctx, derivedData, vertexCos, numVerts);
|
deformVerts(md, ctx, derivedData, vertexCos, numVerts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformMatricesEM(ModifierData *UNUSED(md), const ModifierEvalContext *ctx,
|
static void deformMatricesEM(
|
||||||
struct BMEditMesh *UNUSED(editData),
|
ModifierData *UNUSED(md), const ModifierEvalContext *ctx,
|
||||||
DerivedMesh *UNUSED(derivedData),
|
struct BMEditMesh *UNUSED(editData),
|
||||||
float (*vertexCos)[3],
|
DerivedMesh *UNUSED(derivedData),
|
||||||
float (*defMats)[3][3],
|
float (*vertexCos)[3],
|
||||||
int numVerts)
|
float (*defMats)[3][3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
Key *key = BKE_key_from_object(ctx->object);
|
Key *key = BKE_key_from_object(ctx->object);
|
||||||
KeyBlock *kb = BKE_keyblock_from_object(ctx->object);
|
KeyBlock *kb = BKE_keyblock_from_object(ctx->object);
|
||||||
|
@@ -97,10 +97,11 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk,
|
|||||||
walk(userData, ob, &smd->auxTarget, IDWALK_CB_NOP);
|
walk(userData, ob, &smd->auxTarget, IDWALK_CB_NOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
Mesh *mesh,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
Mesh *mesh,
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
Mesh *mesh_src = mesh;
|
Mesh *mesh_src = mesh;
|
||||||
|
|
||||||
@@ -113,9 +114,10 @@ static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
|||||||
shrinkwrapModifier_deform((ShrinkwrapModifierData *)md, ctx->object, mesh_src, vertexCos, numVerts, ctx);
|
shrinkwrapModifier_deform((ShrinkwrapModifierData *)md, ctx->object, mesh_src, vertexCos, numVerts, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVertsEM(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVertsEM(
|
||||||
struct BMEditMesh *editData, Mesh *mesh,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3], int numVerts)
|
struct BMEditMesh *editData, Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
Mesh *mesh_src = mesh;
|
Mesh *mesh_src = mesh;
|
||||||
|
|
||||||
|
@@ -186,8 +186,9 @@ static void simpleDeform_bend(const float factor, const int axis, const float dc
|
|||||||
|
|
||||||
|
|
||||||
/* simple deform modifier */
|
/* simple deform modifier */
|
||||||
static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, struct Mesh *mesh,
|
static void SimpleDeformModifier_do(
|
||||||
float (*vertexCos)[3], int numVerts)
|
SimpleDeformModifierData *smd, struct Object *ob, struct Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
const float base_limit[2] = {0.0f, 0.0f};
|
const float base_limit[2] = {0.0f, 0.0f};
|
||||||
int i;
|
int i;
|
||||||
@@ -379,10 +380,11 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
struct Mesh *mesh,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
struct Mesh *mesh,
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
||||||
|
|
||||||
@@ -393,11 +395,12 @@ static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVertsEM(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVertsEM(
|
||||||
struct BMEditMesh *editData,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
struct Mesh *mesh,
|
struct BMEditMesh *editData,
|
||||||
float (*vertexCos)[3],
|
struct Mesh *mesh,
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
Mesh *mesh_src = get_mesh(ctx->object, editData, mesh, NULL, false, false);
|
Mesh *mesh_src = get_mesh(ctx->object, editData, mesh, NULL, false, false);
|
||||||
|
|
||||||
|
@@ -134,16 +134,18 @@ typedef struct {
|
|||||||
int mat_nr;
|
int mat_nr;
|
||||||
} SkinOutput;
|
} SkinOutput;
|
||||||
|
|
||||||
static void add_poly(SkinOutput *so,
|
static void add_poly(
|
||||||
BMVert *v1,
|
SkinOutput *so,
|
||||||
BMVert *v2,
|
BMVert *v1,
|
||||||
BMVert *v3,
|
BMVert *v2,
|
||||||
BMVert *v4);
|
BMVert *v3,
|
||||||
|
BMVert *v4);
|
||||||
|
|
||||||
/***************************** Convex Hull ****************************/
|
/***************************** Convex Hull ****************************/
|
||||||
|
|
||||||
static bool is_quad_symmetric(BMVert *quad[4],
|
static bool is_quad_symmetric(
|
||||||
const SkinModifierData *smd)
|
BMVert *quad[4],
|
||||||
|
const SkinModifierData *smd)
|
||||||
{
|
{
|
||||||
const float threshold = 0.0001f;
|
const float threshold = 0.0001f;
|
||||||
const float threshold_squared = threshold * threshold;
|
const float threshold_squared = threshold * threshold;
|
||||||
@@ -175,8 +177,9 @@ static bool is_quad_symmetric(BMVert *quad[4],
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Returns true if the quad crosses the plane of symmetry, false otherwise */
|
/* Returns true if the quad crosses the plane of symmetry, false otherwise */
|
||||||
static bool quad_crosses_symmetry_plane(BMVert *quad[4],
|
static bool quad_crosses_symmetry_plane(
|
||||||
const SkinModifierData *smd)
|
BMVert *quad[4],
|
||||||
|
const SkinModifierData *smd)
|
||||||
{
|
{
|
||||||
int axis;
|
int axis;
|
||||||
|
|
||||||
@@ -202,8 +205,9 @@ static bool quad_crosses_symmetry_plane(BMVert *quad[4],
|
|||||||
|
|
||||||
/* Returns true if the frame is filled by precisely two faces (and
|
/* Returns true if the frame is filled by precisely two faces (and
|
||||||
* outputs those faces to fill_faces), otherwise returns false. */
|
* outputs those faces to fill_faces), otherwise returns false. */
|
||||||
static bool skin_frame_find_contained_faces(const Frame *frame,
|
static bool skin_frame_find_contained_faces(
|
||||||
BMFace *fill_faces[2])
|
const Frame *frame,
|
||||||
|
BMFace *fill_faces[2])
|
||||||
{
|
{
|
||||||
BMEdge *diag;
|
BMEdge *diag;
|
||||||
|
|
||||||
@@ -410,9 +414,10 @@ static void merge_frame_corners(Frame **frames, int totframe)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Frame **collect_hull_frames(int v, SkinNode *frames,
|
static Frame **collect_hull_frames(
|
||||||
const MeshElemMap *emap, const MEdge *medge,
|
int v, SkinNode *frames,
|
||||||
int *tothullframe)
|
const MeshElemMap *emap, const MEdge *medge,
|
||||||
|
int *tothullframe)
|
||||||
{
|
{
|
||||||
SkinNode *f;
|
SkinNode *f;
|
||||||
Frame **hull_frames;
|
Frame **hull_frames;
|
||||||
@@ -450,9 +455,10 @@ static void node_frames_init(SkinNode *nf, int totframe)
|
|||||||
nf->seam_edges[i] = -1;
|
nf->seam_edges[i] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_frame(Frame *frame, const float co[3],
|
static void create_frame(
|
||||||
const float radius[2],
|
Frame *frame, const float co[3],
|
||||||
float mat[3][3], float offset)
|
const float radius[2],
|
||||||
|
float mat[3][3], float offset)
|
||||||
{
|
{
|
||||||
float rx[3], ry[3], rz[3];
|
float rx[3], ry[3], rz[3];
|
||||||
int i;
|
int i;
|
||||||
@@ -482,9 +488,10 @@ static float half_v2(const float v[2])
|
|||||||
return (v[0] + v[1]) * 0.5f;
|
return (v[0] + v[1]) * 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void end_node_frames(int v, SkinNode *skin_nodes, const MVert *mvert,
|
static void end_node_frames(
|
||||||
const MVertSkin *nodes, const MeshElemMap *emap,
|
int v, SkinNode *skin_nodes, const MVert *mvert,
|
||||||
EMat *emat)
|
const MVertSkin *nodes, const MeshElemMap *emap,
|
||||||
|
EMat *emat)
|
||||||
{
|
{
|
||||||
const float *rad = nodes[v].radius;
|
const float *rad = nodes[v].radius;
|
||||||
float mat[3][3];
|
float mat[3][3];
|
||||||
@@ -555,9 +562,10 @@ static int connection_node_mat(float mat[3][3], int v, const MeshElemMap *emap,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void connection_node_frames(int v, SkinNode *skin_nodes, const MVert *mvert,
|
static void connection_node_frames(
|
||||||
const MVertSkin *nodes, const MeshElemMap *emap,
|
int v, SkinNode *skin_nodes, const MVert *mvert,
|
||||||
EMat *emat)
|
const MVertSkin *nodes, const MeshElemMap *emap,
|
||||||
|
EMat *emat)
|
||||||
{
|
{
|
||||||
const float *rad = nodes[v].radius;
|
const float *rad = nodes[v].radius;
|
||||||
float mat[3][3];
|
float mat[3][3];
|
||||||
@@ -593,9 +601,10 @@ static void connection_node_frames(int v, SkinNode *skin_nodes, const MVert *mve
|
|||||||
create_frame(&skin_nodes[v].frames[0], mvert[v].co, rad, mat, 0);
|
create_frame(&skin_nodes[v].frames[0], mvert[v].co, rad, mat, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static SkinNode *build_frames(const MVert *mvert, int totvert,
|
static SkinNode *build_frames(
|
||||||
const MVertSkin *nodes, const MeshElemMap *emap,
|
const MVert *mvert, int totvert,
|
||||||
EMat *emat)
|
const MVertSkin *nodes, const MeshElemMap *emap,
|
||||||
|
EMat *emat)
|
||||||
{
|
{
|
||||||
SkinNode *skin_nodes;
|
SkinNode *skin_nodes;
|
||||||
int v;
|
int v;
|
||||||
@@ -652,9 +661,10 @@ typedef struct {
|
|||||||
int e;
|
int e;
|
||||||
} EdgeStackElem;
|
} EdgeStackElem;
|
||||||
|
|
||||||
static void build_emats_stack(BLI_Stack *stack, BLI_bitmap *visited_e, EMat *emat,
|
static void build_emats_stack(
|
||||||
const MeshElemMap *emap, const MEdge *medge,
|
BLI_Stack *stack, BLI_bitmap *visited_e, EMat *emat,
|
||||||
const MVertSkin *vs, const MVert *mvert)
|
const MeshElemMap *emap, const MEdge *medge,
|
||||||
|
const MVertSkin *vs, const MVert *mvert)
|
||||||
{
|
{
|
||||||
EdgeStackElem stack_elem;
|
EdgeStackElem stack_elem;
|
||||||
float axis[3], angle;
|
float axis[3], angle;
|
||||||
@@ -705,13 +715,14 @@ static void build_emats_stack(BLI_Stack *stack, BLI_bitmap *visited_e, EMat *ema
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static EMat *build_edge_mats(const MVertSkin *vs,
|
static EMat *build_edge_mats(
|
||||||
const MVert *mvert,
|
const MVertSkin *vs,
|
||||||
int totvert,
|
const MVert *mvert,
|
||||||
const MEdge *medge,
|
int totvert,
|
||||||
const MeshElemMap *emap,
|
const MEdge *medge,
|
||||||
int totedge,
|
const MeshElemMap *emap,
|
||||||
bool *has_valid_root)
|
int totedge,
|
||||||
|
bool *has_valid_root)
|
||||||
{
|
{
|
||||||
BLI_Stack *stack;
|
BLI_Stack *stack;
|
||||||
EMat *emat;
|
EMat *emat;
|
||||||
@@ -763,8 +774,9 @@ static EMat *build_edge_mats(const MVertSkin *vs,
|
|||||||
* nodes, at least two intermediate frames are required. (This avoids
|
* nodes, at least two intermediate frames are required. (This avoids
|
||||||
* having any special cases for dealing with sharing a frame between
|
* having any special cases for dealing with sharing a frame between
|
||||||
* two hulls.) */
|
* two hulls.) */
|
||||||
static int calc_edge_subdivisions(const MVert *mvert, const MVertSkin *nodes,
|
static int calc_edge_subdivisions(
|
||||||
const MEdge *e, const int *degree)
|
const MVert *mvert, const MVertSkin *nodes,
|
||||||
|
const MEdge *e, const int *degree)
|
||||||
{
|
{
|
||||||
/* prevent memory errors [#38003] */
|
/* prevent memory errors [#38003] */
|
||||||
#define NUM_SUBDIVISIONS_MAX 128
|
#define NUM_SUBDIVISIONS_MAX 128
|
||||||
@@ -956,11 +968,12 @@ static Mesh *subdivide_base(Mesh *orig)
|
|||||||
/******************************* Output *******************************/
|
/******************************* Output *******************************/
|
||||||
|
|
||||||
/* Can be either quad or triangle */
|
/* Can be either quad or triangle */
|
||||||
static void add_poly(SkinOutput *so,
|
static void add_poly(
|
||||||
BMVert *v1,
|
SkinOutput *so,
|
||||||
BMVert *v2,
|
BMVert *v1,
|
||||||
BMVert *v3,
|
BMVert *v2,
|
||||||
BMVert *v4)
|
BMVert *v3,
|
||||||
|
BMVert *v4)
|
||||||
{
|
{
|
||||||
BMVert *verts[4] = {v1, v2, v3, v4};
|
BMVert *verts[4] = {v1, v2, v3, v4};
|
||||||
BMFace *f;
|
BMFace *f;
|
||||||
@@ -1031,9 +1044,10 @@ static void connect_frames(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void output_frames(BMesh *bm,
|
static void output_frames(
|
||||||
SkinNode *sn,
|
BMesh *bm,
|
||||||
const MDeformVert *input_dvert)
|
SkinNode *sn,
|
||||||
|
const MDeformVert *input_dvert)
|
||||||
{
|
{
|
||||||
Frame *f;
|
Frame *f;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@@ -102,8 +102,9 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static DerivedMesh *applyModifier(
|
||||||
DerivedMesh *dm)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
DerivedMesh *dm)
|
||||||
{
|
{
|
||||||
SmokeModifierData *smd = (SmokeModifierData *) md;
|
SmokeModifierData *smd = (SmokeModifierData *) md;
|
||||||
|
|
||||||
@@ -143,8 +144,9 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachIDLink(ModifierData *md, Object *ob,
|
static void foreachIDLink(
|
||||||
IDWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
IDWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
SmokeModifierData *smd = (SmokeModifierData *) md;
|
SmokeModifierData *smd = (SmokeModifierData *) md;
|
||||||
|
|
||||||
|
@@ -209,8 +209,9 @@ static void smoothModifier_do(
|
|||||||
MEM_freeN(uctmp);
|
MEM_freeN(uctmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh,
|
static void deformVerts(
|
||||||
float (*vertexCos)[3], int numVerts)
|
ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
Mesh *mesh_src = mesh;
|
Mesh *mesh_src = mesh;
|
||||||
|
|
||||||
|
@@ -49,10 +49,11 @@
|
|||||||
|
|
||||||
#include "MOD_modifiertypes.h"
|
#include "MOD_modifiertypes.h"
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
DerivedMesh *UNUSED(derivedData),
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
DerivedMesh *UNUSED(derivedData),
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
sbObjectStep(ctx->depsgraph, md->scene, ctx->object, (float)md->scene->r.cfra, vertexCos, numVerts);
|
sbObjectStep(ctx->depsgraph, md->scene, ctx->object, (float)md->scene->r.cfra, vertexCos, numVerts);
|
||||||
}
|
}
|
||||||
|
@@ -99,8 +99,9 @@ static bool isDisabled(ModifierData *md, int useRenderParams)
|
|||||||
return get_render_subsurf_level(&md->scene->r, levels, useRenderParams != 0) == 0;
|
return get_render_subsurf_level(&md->scene->r, levels, useRenderParams != 0) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static DerivedMesh *applyModifier(
|
||||||
DerivedMesh *derivedData)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
DerivedMesh *derivedData)
|
||||||
{
|
{
|
||||||
SubsurfModifierData *smd = (SubsurfModifierData *) md;
|
SubsurfModifierData *smd = (SubsurfModifierData *) md;
|
||||||
SubsurfFlags subsurf_flags = 0;
|
SubsurfFlags subsurf_flags = 0;
|
||||||
|
@@ -82,10 +82,11 @@ static bool dependsOnTime(ModifierData *UNUSED(md))
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
DerivedMesh *derivedData,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
DerivedMesh *derivedData,
|
||||||
int UNUSED(numVerts))
|
float (*vertexCos)[3],
|
||||||
|
int UNUSED(numVerts))
|
||||||
{
|
{
|
||||||
SurfaceModifierData *surmd = (SurfaceModifierData *) md;
|
SurfaceModifierData *surmd = (SurfaceModifierData *) md;
|
||||||
|
|
||||||
|
@@ -188,8 +188,9 @@ static void freeAdjacencyMap(SDefAdjacencyArray * const vert_edges, SDefAdjacenc
|
|||||||
MEM_freeN(vert_edges);
|
MEM_freeN(vert_edges);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int buildAdjacencyMap(const MPoly *poly, const MEdge *edge, const MLoop * const mloop, const unsigned int numpoly, const unsigned int numedges,
|
static int buildAdjacencyMap(
|
||||||
SDefAdjacencyArray * const vert_edges, SDefAdjacency *adj, SDefEdgePolys * const edge_polys)
|
const MPoly *poly, const MEdge *edge, const MLoop * const mloop, const unsigned int numpoly, const unsigned int numedges,
|
||||||
|
SDefAdjacencyArray * const vert_edges, SDefAdjacency *adj, SDefEdgePolys * const edge_polys)
|
||||||
{
|
{
|
||||||
const MLoop *loop;
|
const MLoop *loop;
|
||||||
|
|
||||||
@@ -908,8 +909,9 @@ static void bindVert(
|
|||||||
freeBindData(bwdata);
|
freeBindData(bwdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool surfacedeformBind(SurfaceDeformModifierData *smd, float (*vertexCos)[3],
|
static bool surfacedeformBind(
|
||||||
unsigned int numverts, unsigned int tnumpoly, unsigned int tnumverts, Mesh *target)
|
SurfaceDeformModifierData *smd, float (*vertexCos)[3],
|
||||||
|
unsigned int numverts, unsigned int tnumpoly, unsigned int tnumverts, Mesh *target)
|
||||||
{
|
{
|
||||||
BVHTreeFromMesh treeData = {NULL};
|
BVHTreeFromMesh treeData = {NULL};
|
||||||
const MVert *mvert = target->mvert;
|
const MVert *mvert = target->mvert;
|
||||||
|
@@ -79,9 +79,10 @@ static void initData(ModifierData *md)
|
|||||||
tmd->ngon_method = MOD_TRIANGULATE_NGON_BEAUTY;
|
tmd->ngon_method = MOD_TRIANGULATE_NGON_BEAUTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Mesh *applyModifier(ModifierData *md,
|
static Mesh *applyModifier(
|
||||||
const ModifierEvalContext *UNUSED(ctx),
|
ModifierData *md,
|
||||||
Mesh *mesh)
|
const ModifierEvalContext *UNUSED(ctx),
|
||||||
|
Mesh *mesh)
|
||||||
{
|
{
|
||||||
TriangulateModifierData *tmd = (TriangulateModifierData *)md;
|
TriangulateModifierData *tmd = (TriangulateModifierData *)md;
|
||||||
Mesh *result;
|
Mesh *result;
|
||||||
|
@@ -152,10 +152,11 @@ void get_texture_coords_mesh(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_texture_coords(MappingInfoModifierData *dmd, Object *ob,
|
void get_texture_coords(
|
||||||
DerivedMesh *dm,
|
MappingInfoModifierData *dmd, Object *ob,
|
||||||
float (*co)[3], float (*texco)[3],
|
DerivedMesh *dm,
|
||||||
int numVerts)
|
float (*co)[3], float (*texco)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int texmapping = dmd->texmapping;
|
int texmapping = dmd->texmapping;
|
||||||
@@ -257,8 +258,9 @@ DerivedMesh *get_cddm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* returns a derived mesh if dm == NULL, for deforming modifiers that need it */
|
/* returns a derived mesh if dm == NULL, for deforming modifiers that need it */
|
||||||
DerivedMesh *get_dm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm,
|
DerivedMesh *get_dm(
|
||||||
float (*vertexCos)[3], bool use_normals, bool use_orco)
|
Object *ob, struct BMEditMesh *em, DerivedMesh *dm,
|
||||||
|
float (*vertexCos)[3], bool use_normals, bool use_orco)
|
||||||
{
|
{
|
||||||
if (dm) {
|
if (dm) {
|
||||||
/* pass */
|
/* pass */
|
||||||
@@ -290,8 +292,9 @@ DerivedMesh *get_dm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* returns a mesh if mesh == NULL, for deforming modifiers that need it */
|
/* returns a mesh if mesh == NULL, for deforming modifiers that need it */
|
||||||
Mesh *get_mesh(Object *ob, struct BMEditMesh *em, Mesh *mesh,
|
Mesh *get_mesh(
|
||||||
float (*vertexCos)[3], bool use_normals, bool use_orco)
|
Object *ob, struct BMEditMesh *em, Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], bool use_normals, bool use_orco)
|
||||||
{
|
{
|
||||||
if (mesh) {
|
if (mesh) {
|
||||||
/* pass */
|
/* pass */
|
||||||
|
@@ -42,8 +42,9 @@ struct Scene;
|
|||||||
struct Tex;
|
struct Tex;
|
||||||
|
|
||||||
void modifier_init_texture(const struct Scene *scene, struct Tex *texture);
|
void modifier_init_texture(const struct Scene *scene, struct Tex *texture);
|
||||||
void get_texture_coords(struct MappingInfoModifierData *dmd, struct Object *ob, struct DerivedMesh *dm,
|
void get_texture_coords(
|
||||||
float (*co)[3], float (*texco)[3], int numVerts);
|
struct MappingInfoModifierData *dmd, struct Object *ob, struct DerivedMesh *dm,
|
||||||
|
float (*co)[3], float (*texco)[3], int numVerts);
|
||||||
void get_texture_coords_mesh(
|
void get_texture_coords_mesh(
|
||||||
struct MappingInfoModifierData *dmd,
|
struct MappingInfoModifierData *dmd,
|
||||||
struct Object *ob,
|
struct Object *ob,
|
||||||
@@ -51,17 +52,22 @@ void get_texture_coords_mesh(
|
|||||||
float (*cos)[3],
|
float (*cos)[3],
|
||||||
float (*r_texco)[3]);
|
float (*r_texco)[3]);
|
||||||
void modifier_vgroup_cache(struct ModifierData *md, float (*vertexCos)[3]);
|
void modifier_vgroup_cache(struct ModifierData *md, float (*vertexCos)[3]);
|
||||||
struct DerivedMesh *get_cddm(struct Object *ob, struct BMEditMesh *em, struct DerivedMesh *dm,
|
struct DerivedMesh *get_cddm(
|
||||||
float (*vertexCos)[3], bool use_normals);
|
struct Object *ob, struct BMEditMesh *em, struct DerivedMesh *dm,
|
||||||
struct DerivedMesh *get_dm(struct Object *ob, struct BMEditMesh *em, struct DerivedMesh *dm,
|
float (*vertexCos)[3], bool use_normals);
|
||||||
float (*vertexCos)[3], bool use_normals, bool use_orco);
|
struct DerivedMesh *get_dm(
|
||||||
struct Mesh *get_mesh(struct Object *ob, struct BMEditMesh *em, struct Mesh *mesh,
|
struct Object *ob, struct BMEditMesh *em, struct DerivedMesh *dm,
|
||||||
float (*vertexCos)[3], bool use_normals, bool use_orco);
|
float (*vertexCos)[3], bool use_normals, bool use_orco);
|
||||||
|
struct Mesh *get_mesh(
|
||||||
|
struct Object *ob, struct BMEditMesh *em, struct Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], bool use_normals, bool use_orco);
|
||||||
struct DerivedMesh *get_dm_for_modifier(struct Object *ob, ModifierApplyFlag flag);
|
struct DerivedMesh *get_dm_for_modifier(struct Object *ob, ModifierApplyFlag flag);
|
||||||
|
|
||||||
void modifier_get_vgroup(struct Object *ob, struct DerivedMesh *dm,
|
void modifier_get_vgroup(
|
||||||
const char *name, struct MDeformVert **dvert, int *defgrp_index);
|
struct Object *ob, struct DerivedMesh *dm,
|
||||||
void modifier_get_vgroup_mesh(struct Object *ob, struct Mesh *mesh,
|
const char *name, struct MDeformVert **dvert, int *defgrp_index);
|
||||||
const char *name, struct MDeformVert **dvert, int *defgrp_index);
|
void modifier_get_vgroup_mesh(
|
||||||
|
struct Object *ob, struct Mesh *mesh,
|
||||||
|
const char *name, struct MDeformVert **dvert, int *defgrp_index);
|
||||||
|
|
||||||
#endif /* __MOD_UTIL_H__ */
|
#endif /* __MOD_UTIL_H__ */
|
||||||
|
@@ -77,8 +77,9 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachObjectLink(ModifierData *md, Object *ob,
|
static void foreachObjectLink(
|
||||||
ObjectWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
ObjectWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
UVProjectModifierData *umd = (UVProjectModifierData *) md;
|
UVProjectModifierData *umd = (UVProjectModifierData *) md;
|
||||||
int i;
|
int i;
|
||||||
@@ -87,8 +88,9 @@ static void foreachObjectLink(ModifierData *md, Object *ob,
|
|||||||
walk(userData, ob, &umd->projectors[i], IDWALK_CB_NOP);
|
walk(userData, ob, &umd->projectors[i], IDWALK_CB_NOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachIDLink(ModifierData *md, Object *ob,
|
static void foreachIDLink(
|
||||||
IDWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
IDWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
UVProjectModifierData *umd = (UVProjectModifierData *) md;
|
UVProjectModifierData *umd = (UVProjectModifierData *) md;
|
||||||
@@ -115,8 +117,9 @@ typedef struct Projector {
|
|||||||
void *uci; /* optional uv-project info (panorama projection) */
|
void *uci; /* optional uv-project info (panorama projection) */
|
||||||
} Projector;
|
} Projector;
|
||||||
|
|
||||||
static Mesh *uvprojectModifier_do(UVProjectModifierData *umd,
|
static Mesh *uvprojectModifier_do(
|
||||||
Object *ob, Mesh *mesh)
|
UVProjectModifierData *umd,
|
||||||
|
Object *ob, Mesh *mesh)
|
||||||
{
|
{
|
||||||
float (*coords)[3], (*co)[3];
|
float (*coords)[3], (*co)[3];
|
||||||
MLoopUV *mloop_uv;
|
MLoopUV *mloop_uv;
|
||||||
@@ -302,8 +305,9 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd,
|
|||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static Mesh *applyModifier(
|
||||||
Mesh *mesh)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
Mesh *mesh)
|
||||||
{
|
{
|
||||||
Mesh *result;
|
Mesh *result;
|
||||||
UVProjectModifierData *umd = (UVProjectModifierData *) md;
|
UVProjectModifierData *umd = (UVProjectModifierData *) md;
|
||||||
|
@@ -43,8 +43,9 @@
|
|||||||
#include "MOD_util.h"
|
#include "MOD_util.h"
|
||||||
|
|
||||||
|
|
||||||
static void uv_warp_from_mat4_pair(float uv_dst[2], const float uv_src[2], float warp_mat[4][4],
|
static void uv_warp_from_mat4_pair(
|
||||||
int axis_u, int axis_v)
|
float uv_dst[2], const float uv_src[2], float warp_mat[4][4],
|
||||||
|
int axis_u, int axis_v)
|
||||||
{
|
{
|
||||||
float tuv[3] = {0.0f};
|
float tuv[3] = {0.0f};
|
||||||
|
|
||||||
@@ -137,8 +138,9 @@ static void uv_warp_compute(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
|
static DerivedMesh *applyModifier(
|
||||||
DerivedMesh *dm)
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
|
DerivedMesh *dm)
|
||||||
{
|
{
|
||||||
UVWarpModifierData *umd = (UVWarpModifierData *) md;
|
UVWarpModifierData *umd = (UVWarpModifierData *) md;
|
||||||
int numPolys, numLoops;
|
int numPolys, numLoops;
|
||||||
@@ -222,9 +224,10 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk,
|
|||||||
walk(userData, ob, &umd->object_src, IDWALK_CB_NOP);
|
walk(userData, ob, &umd->object_src, IDWALK_CB_NOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uv_warp_deps_object_bone_new(struct DepsNodeHandle *node,
|
static void uv_warp_deps_object_bone_new(
|
||||||
Object *object,
|
struct DepsNodeHandle *node,
|
||||||
const char *bonename)
|
Object *object,
|
||||||
|
const char *bonename)
|
||||||
{
|
{
|
||||||
if (object != NULL) {
|
if (object != NULL) {
|
||||||
if (bonename[0])
|
if (bonename[0])
|
||||||
|
@@ -148,8 +148,9 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void warpModifier_do(WarpModifierData *wmd, Object *ob,
|
static void warpModifier_do(
|
||||||
Mesh *mesh, float (*vertexCos)[3], int numVerts)
|
WarpModifierData *wmd, Object *ob,
|
||||||
|
Mesh *mesh, float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
float obinv[4][4];
|
float obinv[4][4];
|
||||||
float mat_from[4][4];
|
float mat_from[4][4];
|
||||||
@@ -303,8 +304,9 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh,
|
static void deformVerts(
|
||||||
float (*vertexCos)[3], int numVerts)
|
ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh,
|
||||||
|
float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
Mesh *mesh_src = mesh;
|
Mesh *mesh_src = mesh;
|
||||||
|
|
||||||
@@ -317,8 +319,9 @@ static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
|
|||||||
warpModifier_do((WarpModifierData *)md, ctx->object, mesh_src, vertexCos, numVerts);
|
warpModifier_do((WarpModifierData *)md, ctx->object, mesh_src, vertexCos, numVerts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVertsEM(ModifierData *md, const ModifierEvalContext *ctx, struct BMEditMesh *em,
|
static void deformVertsEM(
|
||||||
Mesh *mesh, float (*vertexCos)[3], int numVerts)
|
ModifierData *md, const ModifierEvalContext *ctx, struct BMEditMesh *em,
|
||||||
|
Mesh *mesh, float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
Mesh *mesh_src = mesh;
|
Mesh *mesh_src = mesh;
|
||||||
|
|
||||||
|
@@ -94,8 +94,9 @@ static void foreachObjectLink(
|
|||||||
walk(userData, ob, &wmd->map_object, IDWALK_CB_NOP);
|
walk(userData, ob, &wmd->map_object, IDWALK_CB_NOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachIDLink(ModifierData *md, Object *ob,
|
static void foreachIDLink(
|
||||||
IDWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
IDWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
WaveModifierData *wmd = (WaveModifierData *) md;
|
WaveModifierData *wmd = (WaveModifierData *) md;
|
||||||
|
|
||||||
@@ -104,8 +105,9 @@ static void foreachIDLink(ModifierData *md, Object *ob,
|
|||||||
foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData);
|
foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachTexLink(ModifierData *md, Object *ob,
|
static void foreachTexLink(
|
||||||
TexWalkFunc walk, void *userData)
|
ModifierData *md, Object *ob,
|
||||||
|
TexWalkFunc walk, void *userData)
|
||||||
{
|
{
|
||||||
walk(userData, ob, md, "texture");
|
walk(userData, ob, md, "texture");
|
||||||
}
|
}
|
||||||
@@ -138,10 +140,11 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
|
|||||||
return dataMask;
|
return dataMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void waveModifier_do(WaveModifierData *md,
|
static void waveModifier_do(
|
||||||
Depsgraph *depsgraph,
|
WaveModifierData *md,
|
||||||
Object *ob, DerivedMesh *dm,
|
Depsgraph *depsgraph,
|
||||||
float (*vertexCos)[3], int numVerts)
|
Object *ob, DerivedMesh *dm,
|
||||||
|
float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
WaveModifierData *wmd = (WaveModifierData *) md;
|
WaveModifierData *wmd = (WaveModifierData *) md;
|
||||||
MVert *mvert = NULL;
|
MVert *mvert = NULL;
|
||||||
@@ -292,10 +295,11 @@ static void waveModifier_do(WaveModifierData *md,
|
|||||||
if (wmd->texture) MEM_freeN(tex_co);
|
if (wmd->texture) MEM_freeN(tex_co);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
static void deformVerts(
|
||||||
DerivedMesh *derivedData,
|
ModifierData *md, const ModifierEvalContext *ctx,
|
||||||
float (*vertexCos)[3],
|
DerivedMesh *derivedData,
|
||||||
int numVerts)
|
float (*vertexCos)[3],
|
||||||
|
int numVerts)
|
||||||
{
|
{
|
||||||
DerivedMesh *dm = derivedData;
|
DerivedMesh *dm = derivedData;
|
||||||
WaveModifierData *wmd = (WaveModifierData *)md;
|
WaveModifierData *wmd = (WaveModifierData *)md;
|
||||||
|
@@ -115,10 +115,11 @@ void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cm
|
|||||||
* vertex index (in case the weight tables do not cover the whole vertices...).
|
* vertex index (in case the weight tables do not cover the whole vertices...).
|
||||||
* XXX The standard "factor" value is assumed in [0.0, 1.0] range. Else, weird results might appear.
|
* XXX The standard "factor" value is assumed in [0.0, 1.0] range. Else, weird results might appear.
|
||||||
*/
|
*/
|
||||||
void weightvg_do_mask(const int num, const int *indices, float *org_w, const float *new_w,
|
void weightvg_do_mask(
|
||||||
Object *ob, Mesh *mesh, const float fact, const char defgrp_name[MAX_VGROUP_NAME],
|
const int num, const int *indices, float *org_w, const float *new_w,
|
||||||
Scene *scene, Tex *texture, const int tex_use_channel, const int tex_mapping,
|
Object *ob, Mesh *mesh, const float fact, const char defgrp_name[MAX_VGROUP_NAME],
|
||||||
Object *tex_map_object, const char *tex_uvlayer_name)
|
Scene *scene, Tex *texture, const int tex_use_channel, const int tex_mapping,
|
||||||
|
Object *tex_map_object, const char *tex_uvlayer_name)
|
||||||
{
|
{
|
||||||
int ref_didx;
|
int ref_didx;
|
||||||
int i;
|
int i;
|
||||||
@@ -238,9 +239,10 @@ void weightvg_do_mask(const int num, const int *indices, float *org_w, const flo
|
|||||||
* If indices is not NULL, it must be an array of same length as weights, mapping to the real
|
* If indices is not NULL, it must be an array of same length as weights, mapping to the real
|
||||||
* vertex index (in case the weight array does not cover the whole vertices...).
|
* vertex index (in case the weight array does not cover the whole vertices...).
|
||||||
*/
|
*/
|
||||||
void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, MDeformWeight **dws, int num,
|
void weightvg_update_vg(
|
||||||
const int *indices, const float *weights, const bool do_add,
|
MDeformVert *dvert, int defgrp_idx, MDeformWeight **dws, int num,
|
||||||
const float add_thresh, const bool do_rem, const float rem_thresh)
|
const int *indices, const float *weights, const bool do_add,
|
||||||
|
const float add_thresh, const bool do_rem, const float rem_thresh)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@@ -72,17 +72,19 @@ void weightvg_do_map(int num, float *new_w, short mode, struct CurveMapping *cma
|
|||||||
* vertex index (in case the weight tables do not cover the whole vertices...).
|
* vertex index (in case the weight tables do not cover the whole vertices...).
|
||||||
* XXX The standard "factor" value is assumed in [0.0, 1.0] range. Else, weird results might appear.
|
* XXX The standard "factor" value is assumed in [0.0, 1.0] range. Else, weird results might appear.
|
||||||
*/
|
*/
|
||||||
void weightvg_do_mask(const int num, const int *indices, float *org_w, const float *new_w, Object *ob,
|
void weightvg_do_mask(
|
||||||
struct Mesh *mesh, const float fact, const char defgrp_name[MAX_VGROUP_NAME],
|
const int num, const int *indices, float *org_w, const float *new_w, Object *ob,
|
||||||
struct Scene *scene, Tex *texture, const int tex_use_channel, const int tex_mapping,
|
struct Mesh *mesh, const float fact, const char defgrp_name[MAX_VGROUP_NAME],
|
||||||
Object *tex_map_object, const char *tex_uvlayer_name);
|
struct Scene *scene, Tex *texture, const int tex_use_channel, const int tex_mapping,
|
||||||
|
Object *tex_map_object, const char *tex_uvlayer_name);
|
||||||
|
|
||||||
/* Applies weights to given vgroup (defgroup), and optionally add/remove vertices from the group.
|
/* Applies weights to given vgroup (defgroup), and optionally add/remove vertices from the group.
|
||||||
* If indices is not NULL, it must be a table of same length as weights, mapping to the real
|
* If indices is not NULL, it must be a table of same length as weights, mapping to the real
|
||||||
* vertex index (in case the weight table does not cover the whole vertices...).
|
* vertex index (in case the weight table does not cover the whole vertices...).
|
||||||
*/
|
*/
|
||||||
void weightvg_update_vg(struct MDeformVert *dvert, int defgrp_idx, struct MDeformWeight **dws, int num,
|
void weightvg_update_vg(
|
||||||
const int *indices, const float *weights, const bool do_add,
|
struct MDeformVert *dvert, int defgrp_idx, struct MDeformWeight **dws, int num,
|
||||||
const float add_thresh, const bool do_rem, const float rem_thresh);
|
const int *indices, const float *weights, const bool do_add,
|
||||||
|
const float add_thresh, const bool do_rem, const float rem_thresh);
|
||||||
|
|
||||||
#endif /* __MOD_WEIGHTVG_UTIL_H__ */
|
#endif /* __MOD_WEIGHTVG_UTIL_H__ */
|
||||||
|
@@ -154,9 +154,10 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
|||||||
return (wmd->defgrp_name[0] == '\0');
|
return (wmd->defgrp_name[0] == '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
static Mesh *applyModifier(ModifierData *md,
|
static Mesh *applyModifier(
|
||||||
const ModifierEvalContext *ctx,
|
ModifierData *md,
|
||||||
Mesh *mesh)
|
const ModifierEvalContext *ctx,
|
||||||
|
Mesh *mesh)
|
||||||
{
|
{
|
||||||
BLI_assert(mesh != NULL);
|
BLI_assert(mesh != NULL);
|
||||||
|
|
||||||
|
@@ -139,9 +139,10 @@ static void vert2geom_task_cb_ex(
|
|||||||
/**
|
/**
|
||||||
* Find nearest vertex and/or edge and/or face, for each vertex (adapted from shrinkwrap.c).
|
* Find nearest vertex and/or edge and/or face, for each vertex (adapted from shrinkwrap.c).
|
||||||
*/
|
*/
|
||||||
static void get_vert2geom_distance(int numVerts, float (*v_cos)[3],
|
static void get_vert2geom_distance(
|
||||||
float *dist_v, float *dist_e, float *dist_f,
|
int numVerts, float (*v_cos)[3],
|
||||||
Mesh *target, const SpaceTransform *loc2trgt)
|
float *dist_v, float *dist_e, float *dist_f,
|
||||||
|
Mesh *target, const SpaceTransform *loc2trgt)
|
||||||
{
|
{
|
||||||
Vert2GeomData data = {0};
|
Vert2GeomData data = {0};
|
||||||
Vert2GeomDataChunk data_chunk = {{{0}}};
|
Vert2GeomDataChunk data_chunk = {{{0}}};
|
||||||
@@ -207,8 +208,9 @@ static void get_vert2geom_distance(int numVerts, float (*v_cos)[3],
|
|||||||
* Returns the real distance between a vertex and another reference object.
|
* Returns the real distance between a vertex and another reference object.
|
||||||
* Note that it works in final world space (i.e. with constraints etc. applied).
|
* Note that it works in final world space (i.e. with constraints etc. applied).
|
||||||
*/
|
*/
|
||||||
static void get_vert2ob_distance(int numVerts, float (*v_cos)[3], float *dist,
|
static void get_vert2ob_distance(
|
||||||
Object *ob, Object *obr)
|
int numVerts, float (*v_cos)[3], float *dist,
|
||||||
|
Object *ob, Object *obr)
|
||||||
{
|
{
|
||||||
/* Vertex and ref object coordinates. */
|
/* Vertex and ref object coordinates. */
|
||||||
float v_wco[3];
|
float v_wco[3];
|
||||||
|
Reference in New Issue
Block a user