Fixed a UI bug on shrinkwrap constraint
Fixed vertexs weights on simpledeform modifier (they weren't working if the modifier was the first on stack, since it wasnt receiving a DerivedMesh with vertex weights)
This commit is contained in:
@@ -7380,16 +7380,6 @@ static void simpledeformModifier_copyData(ModifierData *md, ModifierData *target
|
||||
memcpy(tsmd->limit, smd->limit, sizeof(tsmd->limit));
|
||||
}
|
||||
|
||||
static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
|
||||
{
|
||||
SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, derivedData, vertexCos, numVerts);
|
||||
}
|
||||
|
||||
static void simpledeformModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
|
||||
{
|
||||
SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, derivedData, vertexCos, numVerts);
|
||||
}
|
||||
|
||||
static CustomDataMask simpledeformModifier_requiredDataMask(ModifierData *md)
|
||||
{
|
||||
SimpleDeformModifierData *smd = (SimpleDeformModifierData *)md;
|
||||
@@ -7416,6 +7406,57 @@ static void simpledeformModifier_updateDepgraph(ModifierData *md, DagForest *for
|
||||
dag_add_relation(forest, dag_get_node(forest, smd->origin), obNode, DAG_RL_OB_DATA, "SimpleDeform Modifier");
|
||||
}
|
||||
|
||||
static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
|
||||
{
|
||||
DerivedMesh *dm = NULL;
|
||||
CustomDataMask dataMask = simpledeformModifier_requiredDataMask(md);
|
||||
|
||||
/* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */
|
||||
if(dataMask)
|
||||
{
|
||||
if(derivedData) dm = CDDM_copy(derivedData);
|
||||
else if(ob->type==OB_MESH) dm = CDDM_from_mesh(ob->data, ob);
|
||||
else return;
|
||||
|
||||
if(dataMask & CD_MVERT)
|
||||
{
|
||||
CDDM_apply_vert_coords(dm, vertexCos);
|
||||
CDDM_calc_normals(dm);
|
||||
}
|
||||
}
|
||||
|
||||
SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, dm, vertexCos, numVerts);
|
||||
|
||||
if(dm)
|
||||
dm->release(dm);
|
||||
|
||||
}
|
||||
|
||||
static void simpledeformModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
|
||||
{
|
||||
DerivedMesh *dm = NULL;
|
||||
CustomDataMask dataMask = simpledeformModifier_requiredDataMask(md);
|
||||
|
||||
/* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */
|
||||
if(dataMask)
|
||||
{
|
||||
if(derivedData) dm = CDDM_copy(derivedData);
|
||||
else if(ob->type==OB_MESH) dm = CDDM_from_editmesh(editData, ob->data);
|
||||
else return;
|
||||
|
||||
if(dataMask & CD_MVERT)
|
||||
{
|
||||
CDDM_apply_vert_coords(dm, vertexCos);
|
||||
CDDM_calc_normals(dm);
|
||||
}
|
||||
}
|
||||
|
||||
SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, dm, vertexCos, numVerts);
|
||||
|
||||
if(dm)
|
||||
dm->release(dm);
|
||||
}
|
||||
|
||||
/***/
|
||||
|
||||
static ModifierTypeInfo typeArr[NUM_MODIFIER_TYPES];
|
||||
|
||||
@@ -1747,7 +1747,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
|
||||
bShrinkwrapConstraint *data = con->data;
|
||||
char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|projection %x1|nearest vertex %x2";
|
||||
|
||||
height = 60;
|
||||
height = 78;
|
||||
if(data->shrinkType == MOD_SHRINKWRAP_PROJECT)
|
||||
height += 18;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user