Merge branch 'master' into blender2.8

This commit is contained in:
Campbell Barton
2018-02-02 14:15:29 +11:00
7 changed files with 178 additions and 164 deletions

View File

@@ -107,7 +107,10 @@ add_definitions(-D_ALLOW_KEYWORD_MACROS)
add_definitions(-D_WIN32_WINNT=0x600) add_definitions(-D_WIN32_WINNT=0x600)
# Make cmake find the msvc redistributables # Make cmake find the msvc redistributables
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP FALSE)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
include(InstallRequiredSystemLibraries) include(InstallRequiredSystemLibraries)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")

View File

@@ -208,7 +208,11 @@ public:
void setup(ShaderData *sd, int path_flag, float3 weight) void setup(ShaderData *sd, int path_flag, float3 weight)
{ {
MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
sd->flag |= (bsdf) ? bsdf_microfacet_ggx_clearcoat_setup(bsdf, sd) : 0; if(!bsdf) {
return;
}
sd->flag |= bsdf_microfacet_ggx_clearcoat_setup(bsdf, sd);
} }
}; };
@@ -391,9 +395,13 @@ public:
void setup(ShaderData *sd, int path_flag, float3 weight) void setup(ShaderData *sd, int path_flag, float3 weight)
{ {
MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
if(!bsdf) {
return;
}
bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->T = make_float3(0.0f, 0.0f, 0.0f);
bsdf->alpha_y = bsdf->alpha_x; bsdf->alpha_y = bsdf->alpha_x;
sd->flag |= (bsdf) ? bsdf_microfacet_ggx_fresnel_setup(bsdf, sd) : 0; sd->flag |= bsdf_microfacet_ggx_fresnel_setup(bsdf, sd);
} }
}; };
@@ -417,7 +425,11 @@ public:
void setup(ShaderData *sd, int path_flag, float3 weight) void setup(ShaderData *sd, int path_flag, float3 weight)
{ {
MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
sd->flag |= (bsdf) ? bsdf_microfacet_ggx_aniso_fresnel_setup(bsdf, sd) : 0; if(!bsdf) {
return;
}
sd->flag |= bsdf_microfacet_ggx_aniso_fresnel_setup(bsdf, sd);
} }
}; };
@@ -478,10 +490,14 @@ public:
void setup(ShaderData *sd, int path_flag, float3 weight) void setup(ShaderData *sd, int path_flag, float3 weight)
{ {
MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
if(!bsdf) {
return;
}
bsdf->ior = 0.0f; bsdf->ior = 0.0f;
bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->T = make_float3(0.0f, 0.0f, 0.0f);
bsdf->alpha_y = bsdf->alpha_x; bsdf->alpha_y = bsdf->alpha_x;
sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_setup(bsdf) : 0; sd->flag |= bsdf_microfacet_multi_ggx_setup(bsdf);
} }
}; };
@@ -503,8 +519,12 @@ public:
void setup(ShaderData *sd, int path_flag, float3 weight) void setup(ShaderData *sd, int path_flag, float3 weight)
{ {
MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
if(!bsdf) {
return;
}
bsdf->ior = 0.0f; bsdf->ior = 0.0f;
sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_aniso_setup(bsdf) : 0; sd->flag |= bsdf_microfacet_multi_ggx_aniso_setup(bsdf);
} }
}; };
@@ -530,9 +550,13 @@ public:
void setup(ShaderData *sd, int path_flag, float3 weight) void setup(ShaderData *sd, int path_flag, float3 weight)
{ {
MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
if(!bsdf) {
return;
}
bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->T = make_float3(0.0f, 0.0f, 0.0f);
bsdf->alpha_y = bsdf->alpha_x; bsdf->alpha_y = bsdf->alpha_x;
sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_glass_setup(bsdf) : 0; sd->flag |= bsdf_microfacet_multi_ggx_glass_setup(bsdf);
} }
}; };
@@ -591,9 +615,13 @@ public:
void setup(ShaderData *sd, int path_flag, float3 weight) void setup(ShaderData *sd, int path_flag, float3 weight)
{ {
MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
if(!bsdf) {
return;
}
bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->T = make_float3(0.0f, 0.0f, 0.0f);
bsdf->alpha_y = bsdf->alpha_x; bsdf->alpha_y = bsdf->alpha_x;
sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_fresnel_setup(bsdf, sd) : 0; sd->flag |= bsdf_microfacet_multi_ggx_fresnel_setup(bsdf, sd);
} }
}; };
@@ -617,7 +645,11 @@ public:
void setup(ShaderData *sd, int path_flag, float3 weight) void setup(ShaderData *sd, int path_flag, float3 weight)
{ {
MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_aniso_fresnel_setup(bsdf, sd) : 0; if(!bsdf) {
return;
}
sd->flag |= bsdf_microfacet_multi_ggx_aniso_fresnel_setup(bsdf, sd);
} }
}; };
@@ -645,9 +677,13 @@ public:
void setup(ShaderData *sd, int path_flag, float3 weight) void setup(ShaderData *sd, int path_flag, float3 weight)
{ {
MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
if(!bsdf) {
return;
}
bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->T = make_float3(0.0f, 0.0f, 0.0f);
bsdf->alpha_y = bsdf->alpha_x; bsdf->alpha_y = bsdf->alpha_x;
sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_glass_fresnel_setup(bsdf, sd) : 0; sd->flag |= bsdf_microfacet_multi_ggx_glass_fresnel_setup(bsdf, sd);
} }
}; };
@@ -720,7 +756,11 @@ public:
volume_extinction_setup(sd, weight); volume_extinction_setup(sd, weight);
HenyeyGreensteinVolume *volume = (HenyeyGreensteinVolume*)bsdf_alloc_osl(sd, sizeof(HenyeyGreensteinVolume), weight, &params); HenyeyGreensteinVolume *volume = (HenyeyGreensteinVolume*)bsdf_alloc_osl(sd, sizeof(HenyeyGreensteinVolume), weight, &params);
sd->flag |= (volume) ? volume_henyey_greenstein_setup(volume) : 0; if(!volume) {
return;
}
sd->flag |= volume_henyey_greenstein_setup(volume);
} }
}; };

View File

@@ -299,15 +299,15 @@ int DocumentExporter::exportCurrentScene(const EvaluationContext *eval_ctx, Scen
// <library_visual_scenes> // <library_visual_scenes>
SceneExporter se(writer, &arm_exporter, this->export_settings); SceneExporter se(writer, &arm_exporter, this->export_settings);
#if 0
/* The following code seems to be an obsolete workaround
Comment out until it proofs correct that we no longer need it.
*/
// <library_animations> // <library_animations>
AnimationExporter ae(writer, this->export_settings); AnimationExporter ae(writer, this->export_settings);
bool has_animations = ae.exportAnimations(eval_ctx, sce); bool has_animations = ae.exportAnimations(eval_ctx, sce);
#if 0
/* The following code seems to be an obsolete workaround
Comment out until it proofs correct that we no longer need it.
*/
if (has_animations && this->export_settings->export_transformation_type == BC_TRANSFORMATION_TYPE_MATRIX) { if (has_animations && this->export_settings->export_transformation_type == BC_TRANSFORMATION_TYPE_MATRIX) {
// channels adressing <matrix> objects is not (yet) supported // channels adressing <matrix> objects is not (yet) supported
// So we force usage of <location>, <translation> and <scale> // So we force usage of <location>, <translation> and <scale>

View File

@@ -1027,6 +1027,13 @@ bool UI_view2d_tab_set(View2D *v2d, int tab)
void UI_view2d_zoom_cache_reset(void) void UI_view2d_zoom_cache_reset(void)
{ {
/* TODO(sergey): This way we avoid threading conflict with VSE rendering
* text strip. But ideally we want to make glyph cache to be fully safe
* for threading.
*/
if (G.is_rendering) {
return;
}
/* While scaling we can accumulate fonts at many sizes (~20 or so). /* While scaling we can accumulate fonts at many sizes (~20 or so).
* Not an issue with embedded font, but can use over 500Mb with i18n ones! See [#38244]. */ * Not an issue with embedded font, but can use over 500Mb with i18n ones! See [#38244]. */

View File

@@ -255,9 +255,10 @@ bool ED_vgroup_parray_alloc(ID *id, MDeformVert ***dvert_arr, int *dvert_tot, co
* *
* \note \a dvert_array has mirrored weights filled in, incase cleanup operations are needed on both. * \note \a dvert_array has mirrored weights filled in, incase cleanup operations are needed on both.
*/ */
void ED_vgroup_parray_mirror_sync(Object *ob, void ED_vgroup_parray_mirror_sync(
MDeformVert **dvert_array, const int dvert_tot, Object *ob,
const bool *vgroup_validmap, const int vgroup_tot) MDeformVert **dvert_array, const int dvert_tot,
const bool *vgroup_validmap, const int vgroup_tot)
{ {
BMEditMesh *em = BKE_editmesh_from_object(ob); BMEditMesh *em = BKE_editmesh_from_object(ob);
MDeformVert **dvert_array_all = NULL; MDeformVert **dvert_array_all = NULL;
@@ -300,8 +301,9 @@ void ED_vgroup_parray_mirror_sync(Object *ob,
* *
* similar to #ED_vgroup_parray_mirror_sync but only fill in mirror points. * similar to #ED_vgroup_parray_mirror_sync but only fill in mirror points.
*/ */
void ED_vgroup_parray_mirror_assign(Object *ob, void ED_vgroup_parray_mirror_assign(
MDeformVert **dvert_array, const int dvert_tot) Object *ob,
MDeformVert **dvert_array, const int dvert_tot)
{ {
BMEditMesh *em = BKE_editmesh_from_object(ob); BMEditMesh *em = BKE_editmesh_from_object(ob);
MDeformVert **dvert_array_all = NULL; MDeformVert **dvert_array_all = NULL;
@@ -332,9 +334,10 @@ void ED_vgroup_parray_mirror_assign(Object *ob,
MEM_freeN(dvert_array_all); MEM_freeN(dvert_array_all);
} }
void ED_vgroup_parray_remove_zero(MDeformVert **dvert_array, const int dvert_tot, void ED_vgroup_parray_remove_zero(
const bool *vgroup_validmap, const int vgroup_tot, MDeformVert **dvert_array, const int dvert_tot,
const float epsilon, const bool keep_single) const bool *vgroup_validmap, const int vgroup_tot,
const float epsilon, const bool keep_single)
{ {
MDeformVert *dv; MDeformVert *dv;
int i; int i;
@@ -484,9 +487,10 @@ void ED_vgroup_parray_from_weight_array(
/* TODO, cache flip data to speedup calls within a loop. */ /* TODO, cache flip data to speedup calls within a loop. */
static void mesh_defvert_mirror_update_internal(Object *ob, static void mesh_defvert_mirror_update_internal(
MDeformVert *dvert_dst, MDeformVert *dvert_src, Object *ob,
const int def_nr) MDeformVert *dvert_dst, MDeformVert *dvert_src,
const int def_nr)
{ {
if (def_nr == -1) { if (def_nr == -1) {
/* all vgroups, add groups where neded */ /* all vgroups, add groups where neded */
@@ -504,8 +508,9 @@ static void mesh_defvert_mirror_update_internal(Object *ob,
} }
} }
static void ED_mesh_defvert_mirror_update_em(Object *ob, BMVert *eve, int def_nr, int vidx, static void ED_mesh_defvert_mirror_update_em(
const int cd_dvert_offset) Object *ob, BMVert *eve, int def_nr, int vidx,
const int cd_dvert_offset)
{ {
Mesh *me = ob->data; Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh; BMEditMesh *em = me->edit_btmesh;
@@ -713,26 +718,30 @@ const EnumPropertyItem *ED_object_vgroup_selection_itemf_helper(
return item; return item;
} }
static const EnumPropertyItem *rna_vertex_group_with_single_itemf(bContext *C, PointerRNA *ptr, static const EnumPropertyItem *rna_vertex_group_with_single_itemf(
PropertyRNA *prop, bool *r_free) bContext *C, PointerRNA *ptr,
PropertyRNA *prop, bool *r_free)
{ {
return ED_object_vgroup_selection_itemf_helper(C, ptr, prop, r_free, WT_VGROUP_MASK_ALL); return ED_object_vgroup_selection_itemf_helper(C, ptr, prop, r_free, WT_VGROUP_MASK_ALL);
} }
static const EnumPropertyItem *rna_vertex_group_select_itemf(bContext *C, PointerRNA *ptr, static const EnumPropertyItem *rna_vertex_group_select_itemf(
PropertyRNA *prop, bool *r_free) bContext *C, PointerRNA *ptr,
PropertyRNA *prop, bool *r_free)
{ {
return ED_object_vgroup_selection_itemf_helper(C, ptr, prop, r_free, WT_VGROUP_MASK_ALL & ~(1 << WT_VGROUP_ACTIVE)); return ED_object_vgroup_selection_itemf_helper(
C, ptr, prop, r_free, WT_VGROUP_MASK_ALL & ~(1 << WT_VGROUP_ACTIVE));
} }
static void vgroup_operator_subset_select_props(wmOperatorType *ot, bool use_active) static void vgroup_operator_subset_select_props(wmOperatorType *ot, bool use_active)
{ {
PropertyRNA *prop; PropertyRNA *prop;
prop = RNA_def_enum(ot->srna, prop = RNA_def_enum(
"group_select_mode", DummyRNA_NULL_items, ot->srna,
use_active ? WT_VGROUP_ACTIVE : WT_VGROUP_ALL, "Subset", "group_select_mode", DummyRNA_NULL_items,
"Define which subset of Groups shall be used"); use_active ? WT_VGROUP_ACTIVE : WT_VGROUP_ALL, "Subset",
"Define which subset of Groups shall be used");
if (use_active) { if (use_active) {
RNA_def_enum_funcs(prop, rna_vertex_group_with_single_itemf); RNA_def_enum_funcs(prop, rna_vertex_group_with_single_itemf);
@@ -749,9 +758,10 @@ static void vgroup_operator_subset_select_props(wmOperatorType *ot, bool use_act
/* for Mesh in Object mode */ /* for Mesh in Object mode */
/* allows editmode for Lattice */ /* allows editmode for Lattice */
static void ED_vgroup_nr_vert_add(Object *ob, static void ED_vgroup_nr_vert_add(
const int def_nr, const int vertnum, Object *ob,
const float weight, const int assignmode) const int def_nr, const int vertnum,
const float weight, const int assignmode)
{ {
/* add the vert to the deform group with the /* add the vert to the deform group with the
* specified number * specified number
@@ -1222,9 +1232,10 @@ static void getSingleCoordinate(MVert *points, int count, float coord[3])
* compute the amount of vertical distance relative to the plane and store it in dists, * compute the amount of vertical distance relative to the plane and store it in dists,
* then get the horizontal and vertical change and store them in changes * then get the horizontal and vertical change and store them in changes
*/ */
static void getVerticalAndHorizontalChange(const float norm[3], float d, const float coord[3], static void getVerticalAndHorizontalChange(
const float start[3], float distToStart, const float norm[3], float d, const float coord[3],
float *end, float (*changes)[2], float *dists, int index) const float start[3], float distToStart,
float *end, float (*changes)[2], float *dists, int index)
{ {
/* A = Q - ((Q - P).N)N /* A = Q - ((Q - P).N)N
* D = (a * x0 + b * y0 +c * z0 + d) */ * D = (a * x0 + b * y0 +c * z0 + d) */
@@ -1275,8 +1286,9 @@ static DerivedMesh *dm_deform_recalc(EvaluationContext *eval_ctx, Scene *scene,
* norm and d are the plane's properties for the equation: ax + by + cz + d = 0 * norm and d are the plane's properties for the equation: ax + by + cz + d = 0
* coord is a point on the plane * coord is a point on the plane
*/ */
static void moveCloserToDistanceFromPlane(EvaluationContext *eval_ctx, Scene *scene, Object *ob, Mesh *me, int index, float norm[3], static void moveCloserToDistanceFromPlane(
float coord[3], float d, float distToBe, float strength, float cp) EvaluationContext *eval_ctx, Scene *scene, Object *ob, Mesh *me, int index, float norm[3],
float coord[3], float d, float distToBe, float strength, float cp)
{ {
DerivedMesh *dm; DerivedMesh *dm;
MDeformWeight *dw; MDeformWeight *dw;
@@ -1499,9 +1511,10 @@ static void vgroup_fix(const bContext *C, Scene *scene, Object *ob, float distTo
} }
} }
static void vgroup_levels_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, static void vgroup_levels_subset(
const int UNUSED(subset_count), Object *ob, const bool *vgroup_validmap, const int vgroup_tot,
const float offset, const float gain) const int UNUSED(subset_count),
const float offset, const float gain)
{ {
MDeformWeight *dw; MDeformWeight *dw;
MDeformVert *dv, **dvert_array = NULL; MDeformVert *dv, **dvert_array = NULL;
@@ -1536,8 +1549,9 @@ static void vgroup_levels_subset(Object *ob, const bool *vgroup_validmap, const
} }
if (use_mirror && use_vert_sel) { if (use_mirror && use_vert_sel) {
ED_vgroup_parray_mirror_sync(ob, dvert_array, dvert_tot, ED_vgroup_parray_mirror_sync(
vgroup_validmap, vgroup_tot); ob, dvert_array, dvert_tot,
vgroup_validmap, vgroup_tot);
} }
MEM_freeN(dvert_array); MEM_freeN(dvert_array);
@@ -1594,12 +1608,14 @@ static bool vgroup_normalize_all(
/* in case its not selected */ /* in case its not selected */
if ((dv = dvert_array[i])) { if ((dv = dvert_array[i])) {
if (lock_flags) { if (lock_flags) {
defvert_normalize_lock_map(dv, vgroup_validmap, vgroup_tot, defvert_normalize_lock_map(
lock_flags, defbase_tot); dv, vgroup_validmap, vgroup_tot,
lock_flags, defbase_tot);
} }
else if (lock_active) { else if (lock_active) {
defvert_normalize_lock_single(dv, vgroup_validmap, vgroup_tot, defvert_normalize_lock_single(
def_nr); dv, vgroup_validmap, vgroup_tot,
def_nr);
} }
else { else {
defvert_normalize_subset(dv, vgroup_validmap, vgroup_tot); defvert_normalize_subset(dv, vgroup_validmap, vgroup_tot);
@@ -1666,9 +1682,10 @@ static void vgroup_lock_all(Object *ob, int action)
} }
} }
static void vgroup_invert_subset(Object *ob, static void vgroup_invert_subset(
const bool *vgroup_validmap, const int vgroup_tot, Object *ob,
const int UNUSED(subset_count), const bool auto_assign, const bool auto_remove) const bool *vgroup_validmap, const int vgroup_tot,
const int UNUSED(subset_count), const bool auto_assign, const bool auto_remove)
{ {
MDeformWeight *dw; MDeformWeight *dw;
MDeformVert *dv, **dvert_array = NULL; MDeformVert *dv, **dvert_array = NULL;
@@ -1707,14 +1724,16 @@ static void vgroup_invert_subset(Object *ob,
} }
if (use_mirror && use_vert_sel) { if (use_mirror && use_vert_sel) {
ED_vgroup_parray_mirror_sync(ob, dvert_array, dvert_tot, ED_vgroup_parray_mirror_sync(
vgroup_validmap, vgroup_tot); ob, dvert_array, dvert_tot,
vgroup_validmap, vgroup_tot);
} }
if (auto_remove) { if (auto_remove) {
ED_vgroup_parray_remove_zero(dvert_array, dvert_tot, ED_vgroup_parray_remove_zero(
vgroup_validmap, vgroup_tot, dvert_array, dvert_tot,
0.0f, false); vgroup_validmap, vgroup_tot,
0.0f, false);
} }
MEM_freeN(dvert_array); MEM_freeN(dvert_array);
@@ -1934,8 +1953,9 @@ static void vgroup_smooth_subset(
/* not so efficient to get 'dvert_array' again just so unselected verts are NULL'd */ /* not so efficient to get 'dvert_array' again just so unselected verts are NULL'd */
if (use_mirror) { if (use_mirror) {
ED_vgroup_parray_alloc(ob->data, &dvert_array, &dvert_tot, true); ED_vgroup_parray_alloc(ob->data, &dvert_array, &dvert_tot, true);
ED_vgroup_parray_mirror_sync(ob, dvert_array, dvert_tot, ED_vgroup_parray_mirror_sync(
vgroup_validmap, vgroup_tot); ob, dvert_array, dvert_tot,
vgroup_validmap, vgroup_tot);
if (dvert_array) if (dvert_array)
MEM_freeN(dvert_array); MEM_freeN(dvert_array);
} }
@@ -1959,11 +1979,12 @@ static int inv_cmp_mdef_vert_weights(const void *a1, const void *a2)
/* Used for limiting the number of influencing bones per vertex when exporting /* Used for limiting the number of influencing bones per vertex when exporting
* skinned meshes. if all_deform_weights is True, limit all deform modifiers * skinned meshes. if all_deform_weights is True, limit all deform modifiers
* to max_weights regardless of type, otherwise, only limit the number of influencing bones per vertex*/ * to max_weights regardless of type, otherwise, only limit the number of influencing bones per vertex*/
static int vgroup_limit_total_subset(Object *ob, static int vgroup_limit_total_subset(
const bool *vgroup_validmap, Object *ob,
const int vgroup_tot, const bool *vgroup_validmap,
const int subset_count, const int vgroup_tot,
const int max_weights) const int subset_count,
const int max_weights)
{ {
MDeformVert *dv, **dvert_array = NULL; MDeformVert *dv, **dvert_array = NULL;
int i, dvert_tot = 0; int i, dvert_tot = 0;
@@ -2030,8 +2051,9 @@ static int vgroup_limit_total_subset(Object *ob,
} }
static void vgroup_clean_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int UNUSED(subset_count), static void vgroup_clean_subset(
const float epsilon, const bool keep_single) Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int UNUSED(subset_count),
const float epsilon, const bool keep_single)
{ {
MDeformVert **dvert_array = NULL; MDeformVert **dvert_array = NULL;
int dvert_tot = 0; int dvert_tot = 0;
@@ -2048,16 +2070,18 @@ static void vgroup_clean_subset(Object *ob, const bool *vgroup_validmap, const i
ED_vgroup_parray_mirror_assign(ob, dvert_array, dvert_tot); ED_vgroup_parray_mirror_assign(ob, dvert_array, dvert_tot);
} }
ED_vgroup_parray_remove_zero(dvert_array, dvert_tot, ED_vgroup_parray_remove_zero(
vgroup_validmap, vgroup_tot, dvert_array, dvert_tot,
epsilon, keep_single); vgroup_validmap, vgroup_tot,
epsilon, keep_single);
MEM_freeN(dvert_array); MEM_freeN(dvert_array);
} }
} }
static void vgroup_quantize_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int UNUSED(subset_count), static void vgroup_quantize_subset(
const int steps) Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int UNUSED(subset_count),
const int steps)
{ {
MDeformVert **dvert_array = NULL; MDeformVert **dvert_array = NULL;
int dvert_tot = 0; int dvert_tot = 0;
@@ -2095,11 +2119,12 @@ static void vgroup_quantize_subset(Object *ob, const bool *vgroup_validmap, cons
} }
} }
static void dvert_mirror_op(MDeformVert *dvert, MDeformVert *dvert_mirr, static void dvert_mirror_op(
const char sel, const char sel_mirr, MDeformVert *dvert, MDeformVert *dvert_mirr,
const int *flip_map, const int flip_map_len, const char sel, const char sel_mirr,
const bool mirror_weights, const bool flip_vgroups, const bool all_vgroups, const int *flip_map, const int flip_map_len,
const int act_vgroup) const bool mirror_weights, const bool flip_vgroups, const bool all_vgroups,
const int act_vgroup)
{ {
BLI_assert(sel || sel_mirr); BLI_assert(sel || sel_mirr);
@@ -2158,10 +2183,11 @@ static void dvert_mirror_op(MDeformVert *dvert, MDeformVert *dvert_mirr,
/* TODO, vgroup locking */ /* TODO, vgroup locking */
/* TODO, face masking */ /* TODO, face masking */
void ED_vgroup_mirror(Object *ob, void ED_vgroup_mirror(
const bool mirror_weights, const bool flip_vgroups, Object *ob,
const bool all_vgroups, const bool use_topology, const bool mirror_weights, const bool flip_vgroups,
int *r_totmirr, int *r_totfail) const bool all_vgroups, const bool use_topology,
int *r_totmirr, int *r_totfail)
{ {
#define VGROUP_MIRR_OP \ #define VGROUP_MIRR_OP \
@@ -3282,12 +3308,13 @@ static int vertex_group_mirror_exec(bContext *C, wmOperator *op)
Object *ob = ED_object_context(C); Object *ob = ED_object_context(C);
int totmirr = 0, totfail = 0; int totmirr = 0, totfail = 0;
ED_vgroup_mirror(ob, ED_vgroup_mirror(
RNA_boolean_get(op->ptr, "mirror_weights"), ob,
RNA_boolean_get(op->ptr, "flip_group_names"), RNA_boolean_get(op->ptr, "mirror_weights"),
RNA_boolean_get(op->ptr, "all_groups"), RNA_boolean_get(op->ptr, "flip_group_names"),
RNA_boolean_get(op->ptr, "use_topology"), RNA_boolean_get(op->ptr, "all_groups"),
&totmirr, &totfail); RNA_boolean_get(op->ptr, "use_topology"),
&totmirr, &totfail);
ED_mesh_report_mirror(op, totmirr, totfail); ED_mesh_report_mirror(op, totmirr, totfail);

View File

@@ -78,8 +78,9 @@ struct VertProjUpdate {
/* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */
/* Internal Init */ /* Internal Init */
static void vpaint_proj_dm_map_cosnos_init__map_cb(void *userData, int index, const float co[3], static void vpaint_proj_dm_map_cosnos_init__map_cb(
const float no_f[3], const short no_s[3]) void *userData, int index, const float co[3],
const float no_f[3], const short no_s[3])
{ {
struct VertProjHandle *vp_handle = userData; struct VertProjHandle *vp_handle = userData;
DMCoNo *co_no = &vp_handle->vcosnos[index]; DMCoNo *co_no = &vp_handle->vcosnos[index];
@@ -131,8 +132,9 @@ static void vpaint_proj_dm_map_cosnos_init(
/* Same as init but take mouse location into account */ /* Same as init but take mouse location into account */
static void vpaint_proj_dm_map_cosnos_update__map_cb(void *userData, int index, const float co[3], static void vpaint_proj_dm_map_cosnos_update__map_cb(
const float no_f[3], const short no_s[3]) void *userData, int index, const float co[3],
const float no_f[3], const short no_s[3])
{ {
struct VertProjUpdate *vp_update = userData; struct VertProjUpdate *vp_update = userData;
struct VertProjHandle *vp_handle = vp_update->vp_handle; struct VertProjHandle *vp_handle = vp_update->vp_handle;
@@ -144,9 +146,10 @@ static void vpaint_proj_dm_map_cosnos_update__map_cb(void *userData, int index,
/* first find distance to this vertex */ /* first find distance to this vertex */
float co_ss[2]; /* screenspace */ float co_ss[2]; /* screenspace */
if (ED_view3d_project_float_object(vp_update->ar, if (ED_view3d_project_float_object(
co, co_ss, vp_update->ar,
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK) co, co_ss,
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
{ {
const float dist_sq = len_squared_v2v2(vp_update->mval_fl, co_ss); const float dist_sq = len_squared_v2v2(vp_update->mval_fl, co_ss);
if (dist_sq > vp_handle->dists_sq[index]) { if (dist_sq > vp_handle->dists_sq[index]) {

View File

@@ -1030,70 +1030,4 @@ if(WIN32 AND NOT WITH_PYTHON_MODULE)
COMPONENT Blender COMPONENT Blender
DESTINATION "." DESTINATION "."
) )
if(CMAKE_CL_64)
set(_WIN_PLATFORM x64)
else()
set(_WIN_PLATFORM x86)
endif()
if(MSVC12_REDIST_DIR)
install(
FILES
${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.CRT/msvcp120.dll
${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.CRT/msvcr120.dll
DESTINATION "."
)
if(WITH_OPENMP)
install(
FILES ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.OpenMP/vcomp120.dll
DESTINATION "."
)
endif()
endif()
if(MSVC14_REDIST_DIR)
set(KITSDIRx86 "$ENV{${ProgramFilesX86_NAME}}/Windows Kits/10/")
set(KITSDIR "$ENV{ProgramFiles}/Windows Kits/10/")
if(IS_DIRECTORY ${KITSDIR})
set(KITSPATH "${KITSDIR}/Redist/ucrt/DLLs/${_WIN_PLATFORM}")
else()
if(IS_DIRECTORY ${KITSDIRx86})
set(KITSPATH "${KITSDIRx86}/Redist/ucrt/DLLs/${_WIN_PLATFORM}")
else()
message(FATAL_ERROR "Windows 10 SDK directory not found")
endif()
endif()
FILE(TO_CMAKE_PATH ${KITSPATH} KITSPATH)
install(
FILES
${KITSPATH}/api-ms-win-core-file-l1-2-0.dll
${KITSPATH}/api-ms-win-core-file-l2-1-0.dll
${KITSPATH}/api-ms-win-core-localization-l1-2-0.dll
${KITSPATH}/api-ms-win-core-processthreads-l1-1-0.dll
${KITSPATH}/api-ms-win-core-processthreads-l1-1-1.dll
${KITSPATH}/api-ms-win-core-synch-l1-1-0.dll
${KITSPATH}/api-ms-win-core-synch-l1-2-0.dll
${KITSPATH}/api-ms-win-core-timezone-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-conio-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-convert-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-environment-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-filesystem-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-heap-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-locale-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-math-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-process-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-runtime-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-stdio-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-string-l1-1-0.dll
${KITSPATH}/api-ms-win-crt-time-l1-1-0.dll
${KITSPATH}/ucrtbase.dll
${MSVC14_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC140.CRT/vcruntime140.dll
DESTINATION "."
)
if(WITH_OPENMP)
install(
FILES ${MSVC14_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC140.OpenMP/vcomp140.dll
DESTINATION "."
)
endif()
endif()
endif() endif()