Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/shrinkwrap.c
| Context not available. | |||||
| float *co = calc->vertexCos[i]; | float *co = calc->vertexCos[i]; | ||||
| float tmp_co[3]; | float tmp_co[3]; | ||||
| float weight = defvert_array_find_weight_safe(calc->dvert, i, calc->vgroup); | float weight = defvert_array_find_weight_safe(calc->dvert, i, calc->vgroup); | ||||
| if(calc->invert_vgroup) weight = 1.0f - weight; | |||||
| if (weight == 0.0f) { | if (weight == 0.0f) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| Context not available. | |||||
| float *co = calc->vertexCos[i]; | float *co = calc->vertexCos[i]; | ||||
| float tmp_co[3]; | float tmp_co[3]; | ||||
| float weight = defvert_array_find_weight_safe(calc->dvert, i, calc->vgroup); | float weight = defvert_array_find_weight_safe(calc->dvert, i, calc->vgroup); | ||||
| if(calc->invert_vgroup) weight = 1.0f - weight; | |||||
| if (weight == 0.0f) continue; | if (weight == 0.0f) continue; | ||||
| /* Convert the vertex to tree coordinates */ | /* Convert the vertex to tree coordinates */ | ||||
| Context not available. | |||||
| /* Main shrinkwrap function */ | /* Main shrinkwrap function */ | ||||
| void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, | void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, | ||||
| float (*vertexCos)[3], int numVerts, bool for_render) | float (*vertexCos)[3], int numVerts, bool for_render, bool invert_vgroup) | ||||
| { | { | ||||
| DerivedMesh *ss_mesh = NULL; | DerivedMesh *ss_mesh = NULL; | ||||
| Context not available. | |||||
| calc.ob = ob; | calc.ob = ob; | ||||
| calc.numVerts = numVerts; | calc.numVerts = numVerts; | ||||
| calc.vertexCos = vertexCos; | calc.vertexCos = vertexCos; | ||||
| calc.invert_vgroup = invert_vgroup; | |||||
| /* DeformVertex */ | /* DeformVertex */ | ||||
| calc.vgroup = defgroup_name_index(calc.ob, calc.smd->vgroup_name); | calc.vgroup = defgroup_name_index(calc.ob, calc.smd->vgroup_name); | ||||
| Context not available. | |||||