[Bf-blender-cvs] [dffecf0c510] soc-2019-bevel-profiles: Merge branch 'master' into soc-2019-bevel-profiles
Hans Goudey
noreply at git.blender.org
Tue Sep 10 03:15:17 CEST 2019
Commit: dffecf0c5103cdaebea8e0140020e25eacfe53f0
Author: Hans Goudey
Date: Mon Sep 9 21:15:03 2019 -0400
Branches: soc-2019-bevel-profiles
https://developer.blender.org/rBdffecf0c5103cdaebea8e0140020e25eacfe53f0
Merge branch 'master' into soc-2019-bevel-profiles
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/scene.c
index 17c2417e86d,dbb39184b1e..431cd4838fb
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@@ -881,20 -720,6 +727,9 @@@ void BKE_scene_init(Scene *sce
copy_v3_v3(gp_brush->curcolor_sub, curcolor_sub);
}
- /* GP Stroke Placement */
- sce->toolsettings->gpencil_v3d_align = GP_PROJECT_VIEWSPACE;
- sce->toolsettings->gpencil_v2d_align = GP_PROJECT_VIEWSPACE;
- sce->toolsettings->gpencil_seq_align = GP_PROJECT_VIEWSPACE;
- sce->toolsettings->gpencil_ima_align = GP_PROJECT_VIEWSPACE;
-
- /* Annotations */
- sce->toolsettings->annotate_v3d_align = GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR;
- sce->toolsettings->annotate_thickness = 3;
-
+ /* Profile Widget */
- printf("(BKE_scene_init) Adding profilewidget to tool settings\n");
+ sce->toolsettings->prwdgt = BKE_profilewidget_add(PROF_PRESET_LINE);
+
for (int i = 0; i < ARRAY_SIZE(sce->orientation_slots); i++) {
sce->orientation_slots[i].index_custom = -1;
}
diff --cc source/blender/blenloader/intern/versioning_280.c
index 2ecf65e0aaa,d06da062d49..ae364f7a949
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -3550,49 -3686,163 +3687,187 @@@ void blo_do_versions_280(FileData *fd,
}
}
+ if (!MAIN_VERSION_ATLEAST(bmain, 281, 3)) {
+ if (U.view_rotate_sensitivity_turntable == 0) {
+ U.view_rotate_sensitivity_turntable = DEG2RADF(0.4f);
+ U.view_rotate_sensitivity_trackball = 1.0f;
+ }
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+ for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+ if (sl->spacetype == SPACE_TEXT) {
+ ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
+ ARegion *ar = do_versions_find_region_or_null(regionbase, RGN_TYPE_UI);
+ if (ar) {
+ ar->alignment = RGN_ALIGN_RIGHT;
+ }
+ }
+ /* Mark outliners as dirty for syncing and enable synced selection */
+ if (sl->spacetype == SPACE_OUTLINER) {
+ SpaceOutliner *soutliner = (SpaceOutliner *)sl;
+ soutliner->sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_ALL;
+ soutliner->flag |= SO_SYNC_SELECT;
+ }
+ }
+ }
+ }
+ for (Mesh *mesh = bmain->meshes.first; mesh; mesh = mesh->id.next) {
+ if (mesh->remesh_voxel_size == 0.0f) {
+ mesh->remesh_voxel_size = 0.1f;
+ }
+ }
+ }
+
+ if (!MAIN_VERSION_ATLEAST(bmain, 281, 4)) {
+ ID *id;
+ FOREACH_MAIN_ID_BEGIN (bmain, id) {
+ bNodeTree *ntree = ntreeFromID(id);
+ if (ntree) {
+ ntree->id.flag |= LIB_PRIVATE_DATA;
+ }
+ }
+ FOREACH_MAIN_ID_END;
+ }
+
+ if (!MAIN_VERSION_ATLEAST(bmain, 281, 5)) {
+ for (Brush *br = bmain->brushes.first; br; br = br->id.next) {
+ if (br->ob_mode & OB_MODE_SCULPT && br->normal_radius_factor == 0.0f) {
+ br->normal_radius_factor = 0.5f;
+ }
+ }
+
+ LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
+ /* Older files do not have a master collection, which is then added through
+ * `BKE_collection_master_add()`, so everything is fine. */
+ if (scene->master_collection != NULL) {
+ scene->master_collection->id.flag |= LIB_PRIVATE_DATA;
+ }
+ }
+ }
+
+ if (!MAIN_VERSION_ATLEAST(bmain, 281, 6)) {
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+ for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+ if (sl->spacetype == SPACE_VIEW3D) {
+ View3D *v3d = (View3D *)sl;
+ v3d->shading.flag |= V3D_SHADING_SCENE_LIGHTS_RENDER | V3D_SHADING_SCENE_WORLD_RENDER;
+
+ /* files by default don't have studio lights selected unless interacted
+ * with the shading popover. When no studiolight could be read, we will
+ * select the default world one. */
+ StudioLight *studio_light = BKE_studiolight_find(v3d->shading.lookdev_light,
+ STUDIOLIGHT_TYPE_WORLD);
+ if (studio_light != NULL) {
+ STRNCPY(v3d->shading.lookdev_light, studio_light->name);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (!MAIN_VERSION_ATLEAST(bmain, 281, 9)) {
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+ for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+ if (sl->spacetype == SPACE_FILE) {
+ SpaceFile *sfile = (SpaceFile *)sl;
+ ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
+ ARegion *ar_ui = do_versions_find_region(regionbase, RGN_TYPE_UI);
+ ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER);
+ ARegion *ar_toolprops = do_versions_find_region_or_null(regionbase,
+ RGN_TYPE_TOOL_PROPS);
+
+ /* Reinsert UI region so that it spawns entire area width */
+ BLI_remlink(regionbase, ar_ui);
+ BLI_insertlinkafter(regionbase, ar_header, ar_ui);
+
+ ar_ui->flag |= RGN_FLAG_DYNAMIC_SIZE;
+
+ if (ar_toolprops && (ar_toolprops->alignment == (RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV))) {
+ SpaceType *stype = BKE_spacetype_from_id(sl->spacetype);
+
+ /* Remove empty region at old location. */
+ BLI_assert(sfile->op == NULL);
+ BKE_area_region_free(stype, ar_toolprops);
+ BLI_freelinkN(regionbase, ar_toolprops);
+ }
+
+ if (sfile->params) {
+ sfile->params->details_flags |= FILE_DETAILS_SIZE | FILE_DETAILS_DATETIME;
+ }
+ }
+ }
+ }
+ }
+
+ /* Convert the BONE_NO_SCALE flag to inherit_scale_mode enum. */
+ if (!DNA_struct_elem_find(fd->filesdna, "Bone", "char", "inherit_scale_mode")) {
+ LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
+ do_version_bones_inherit_scale(&arm->bonebase);
+ }
+ }
+
+ /* Convert the Offset flag to the mix mode enum. */
+ if (!DNA_struct_elem_find(fd->filesdna, "bRotateLikeConstraint", "char", "mix_mode")) {
+ LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+ do_version_constraints_copy_rotation_mix_mode(&ob->constraints);
+ if (ob->pose) {
+ LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
+ do_version_constraints_copy_rotation_mix_mode(&pchan->constraints);
+ }
+ }
+ }
+ }
+
+ /* Added studiolight intensity */
+ if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "float", "studiolight_intensity")) {
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+ for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+ if (sl->spacetype == SPACE_VIEW3D) {
+ View3D *v3d = (View3D *)sl;
+ v3d->shading.studiolight_intensity = 1.0f;
+ }
+ }
+ }
+ }
+ }
+
+ /* Elatic deform brush */
+ for (Brush *br = bmain->brushes.first; br; br = br->id.next) {
+ if (br->ob_mode & OB_MODE_SCULPT && br->elastic_deform_compressibility == 0.0f) {
+ br->elastic_deform_compressibility = 0.5f;
+ }
+ }
+ }
+
{
/* Versioning code until next subversion bump goes here. */
+
+ /* Add custom profile widget to toolsettings for bevel tool */
+ if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "ProfileWidget", "prwdgt")) {
+ for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
+ ToolSettings *ts = scene->toolsettings;
+ if ((ts) && (ts->prwdgt == NULL)) {
+ ts->prwdgt = BKE_profilewidget_add(PROF_PRESET_LINE);
+ }
+ }
+ }
+
+ /* Add custom profile widget to bevel modifier */
+ if (!DNA_struct_elem_find(fd->filesdna, "BevelModifier", "ProfileWidget", "prwdgt")) {
+ for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
+ for (ModifierData *md = object->modifiers.first; md; md = md->next) {
+ if (md->type == eModifierType_Bevel) {
+ BevelModifierData *bmd = (BevelModifierData *)md;
+ if (!bmd->prwdgt) {
+ bmd->prwdgt = BKE_profilewidget_add(PROF_PRESET_LINE);
+ }
+ }
+ }
+ }
+ }
-
- if (U.view_rotate_sensitivity_turntable == 0) {
- U.view_rotate_sensitivity_turntable = DEG2RADF(0.4f);
- U.view_rotate_sensitivity_trackball = 1.0f;
- }
- for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
- for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
- for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
- if (sl->spacetype == SPACE_TEXT) {
- ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
- ARegion *ar = do_versions_find_region_or_null(regionbase, RGN_TYPE_UI);
- if (ar) {
- ar->alignment = RGN_ALIGN_RIGHT;
- }
- }
- }
- }
- }
}
}
diff --cc source/blender/editors/interface/interface_templates.c
index 155f7e74363,aac018db24e..f2fb188288b
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@@ -4313,406 -4502,11 +4504,617 @@@ void uiTemplateCurveMapping(uiLayout *l
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list