Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_array.c
| Show First 20 Lines • Show All 450 Lines • ▼ Show 20 Lines | if (amd->offset_type & MOD_ARR_OFF_RELATIVE) { | ||||
| } | } | ||||
| } | } | ||||
| if (use_offset_ob) { | if (use_offset_ob) { | ||||
| float obinv[4][4]; | float obinv[4][4]; | ||||
| float result_mat[4][4]; | float result_mat[4][4]; | ||||
| if (ctx->object) { | if (ctx->object) { | ||||
| invert_m4_m4(obinv, ctx->object->obmat); | invert_m4_m4(obinv, ctx->object->object_to_world); | ||||
| } | } | ||||
| else { | else { | ||||
| unit_m4(obinv); | unit_m4(obinv); | ||||
| } | } | ||||
| mul_m4_series(result_mat, offset, obinv, amd->offset_ob->obmat); | mul_m4_series(result_mat, offset, obinv, amd->offset_ob->object_to_world); | ||||
| copy_m4_m4(offset, result_mat); | copy_m4_m4(offset, result_mat); | ||||
| } | } | ||||
| /* Check if there is some scaling. If scaling, then we will not translate mapping */ | /* Check if there is some scaling. If scaling, then we will not translate mapping */ | ||||
| mat4_to_size(scale, offset); | mat4_to_size(scale, offset); | ||||
| offset_has_scale = !is_one_v3(scale); | offset_has_scale = !is_one_v3(scale); | ||||
| if (amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob != NULL) { | if (amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob != NULL) { | ||||
| Object *curve_ob = amd->curve_ob; | Object *curve_ob = amd->curve_ob; | ||||
| CurveCache *curve_cache = curve_ob->runtime.curve_cache; | CurveCache *curve_cache = curve_ob->runtime.curve_cache; | ||||
| if (curve_cache != NULL && curve_cache->anim_path_accum_length != NULL) { | if (curve_cache != NULL && curve_cache->anim_path_accum_length != NULL) { | ||||
| float scale_fac = mat4_to_scale(curve_ob->obmat); | float scale_fac = mat4_to_scale(curve_ob->object_to_world); | ||||
| length = scale_fac * BKE_anim_path_get_length(curve_cache); | length = scale_fac * BKE_anim_path_get_length(curve_cache); | ||||
| } | } | ||||
| } | } | ||||
| /* About 67 million vertices max seems a decent limit for now. */ | /* About 67 million vertices max seems a decent limit for now. */ | ||||
| const size_t max_verts_num = 1 << 26; | const size_t max_verts_num = 1 << 26; | ||||
| /* calculate the maximum number of copies which will fit within the | /* calculate the maximum number of copies which will fit within the | ||||
| ▲ Show 20 Lines • Show All 557 Lines • Show Last 20 Lines | |||||