[Bf-blender-cvs] [09098e6539c] tracking_tools: Merge branch 'master' into tracking_tools

Sergey Sharybin noreply at git.blender.org
Thu Dec 1 16:41:04 CET 2022


Commit: 09098e6539c23fad29bd166149233ba25a31c3f4
Author: Sergey Sharybin
Date:   Thu Dec 1 16:40:52 2022 +0100
Branches: tracking_tools
https://developer.blender.org/rB09098e6539c23fad29bd166149233ba25a31c3f4

Merge branch 'master' into tracking_tools

===================================================================



===================================================================

diff --cc release/scripts/startup/bl_ui/space_clip.py
index 6477d36b845,fd46fe3099e..8d2200f0e25
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@@ -2,9 -2,13 +2,12 @@@
  
  import bpy
  from bpy.types import Panel, Header, Menu, UIList
- from bpy.app.translations import pgettext_iface as iface_
+ from bpy.app.translations import (
+     pgettext_iface as iface_,
+     contexts as i18n_contexts,
+ )
  from bl_ui.utils import PresetPanel
  from bl_ui.properties_grease_pencil_common import (
 -    AnnotationDrawingToolsPanel,
      AnnotationDataPanel,
  )
  
@@@ -241,13 -166,14 +244,15 @@@ class CLIP_HT_header(Header)
  
              if sc.view == 'CLIP':
                  r = active_object.reconstruction
 -
                  if r.is_valid and sc.view == 'CLIP':
-                     layout.label(text="Solve error: %.2f px" % (r.average_error))
+                     layout.label(text=iface_("Solve error: %.2f px") %
+                                  (r.average_error),
+                                  translate=False)
  
 +                object_icon = 'CAMERA_DATA' if active_object.is_camera else 'OBJECT_DATA'
 +
                  row = layout.row()
 -                row.prop(sc, "pivot_point", text="", icon_only=True)
 +                row.popover(panel='CLIP_PT_objects', text=active_object.name, icon=object_icon)
                  row = layout.row(align=True)
                  icon = 'LOCKED' if sc.lock_selection else 'UNLOCKED'
                  row.operator("clip.lock_selection_toggle", icon=icon, text="", depress=sc.lock_selection)
diff --cc source/blender/blenloader/intern/versioning_300.cc
index df0dae82474,85078a9902d..bf6a9c30dfc
--- a/source/blender/blenloader/intern/versioning_300.cc
+++ b/source/blender/blenloader/intern/versioning_300.cc
@@@ -3628,32 -3720,17 +3720,45 @@@ void blo_do_versions_300(FileData *fd, 
    {
      /* Keep this block, even when empty. */
  
+     LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
+       if (ntree->type == NTREE_GEOMETRY) {
+         version_node_socket_name(ntree, GEO_NODE_COLLECTION_INFO, "Geometry", "Instances");
+       }
+     }
+ 
+     /* UVSeam fixing distance. */
+     if (!DNA_struct_elem_find(fd->filesdna, "Image", "short", "seam_margin")) {
+       LISTBASE_FOREACH (Image *, image, &bmain->images) {
+         image->seam_margin = 8;
+       }
+     }
++
 +    {
 +      LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
 +        LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
 +          LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
 +            if (sl->spacetype != SPACE_CLIP) {
 +              continue;
 +            }
 +
 +            SpaceClip *space_clip = (SpaceClip *)sl;
 +            ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
 +                                                                   &sl->regionbase;
 +
 +            ARegion *new_tool_header = do_versions_add_region_if_not_found(
 +                regionbase, RGN_TYPE_TOOL_HEADER, "tool header", RGN_TYPE_HEADER);
 +
 +            if (new_tool_header != NULL) {
 +              new_tool_header->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM :
 +                                                                             RGN_ALIGN_TOP;
 +
 +              if (space_clip->view != SC_VIEW_CLIP) {
 +                new_tool_header->flag |= RGN_FLAG_HIDDEN;
 +              }
 +            }
 +          }
 +        }
 +      }
 +    }
    }
 -}
 +}
diff --cc source/blender/blenloader/intern/versioning_defaults.cc
index 00000000000,3ae4d5479f0..5bf273d782e
mode 000000,100644..100644
--- a/source/blender/blenloader/intern/versioning_defaults.cc
+++ b/source/blender/blenloader/intern/versioning_defaults.cc
@@@ -1,0 -1,790 +1,793 @@@
+ /* SPDX-License-Identifier: GPL-2.0-or-later */
+ 
+ /** \file
+  * \ingroup blenloader
+  *
+  * This file handles updating the `startup.blend`, this is used when reading old files.
+  *
+  * Unlike regular versioning this makes changes that ensure the startup file
+  * has brushes and other presets setup to take advantage of newer features.
+  *
+  * To update preference defaults see `userdef_default.c`.
+  */
+ 
+ #include "MEM_guardedalloc.h"
+ 
+ #include "BLI_listbase.h"
+ #include "BLI_math.h"
+ #include "BLI_math_vec_types.hh"
+ #include "BLI_string.h"
+ #include "BLI_system.h"
+ #include "BLI_utildefines.h"
+ 
+ #include "DNA_camera_types.h"
+ #include "DNA_curveprofile_types.h"
+ #include "DNA_gpencil_types.h"
+ #include "DNA_light_types.h"
+ #include "DNA_mask_types.h"
+ #include "DNA_material_types.h"
+ #include "DNA_mesh_types.h"
+ #include "DNA_meshdata_types.h"
+ #include "DNA_object_types.h"
+ #include "DNA_scene_types.h"
+ #include "DNA_screen_types.h"
+ #include "DNA_space_types.h"
+ #include "DNA_userdef_types.h"
+ #include "DNA_windowmanager_types.h"
+ #include "DNA_workspace_types.h"
+ 
+ #include "BKE_appdir.h"
+ #include "BKE_attribute.hh"
+ #include "BKE_brush.h"
+ #include "BKE_colortools.h"
+ #include "BKE_curveprofile.h"
+ #include "BKE_customdata.h"
+ #include "BKE_gpencil.h"
+ #include "BKE_idprop.h"
+ #include "BKE_layer.h"
+ #include "BKE_lib_id.h"
+ #include "BKE_main.h"
+ #include "BKE_main_namemap.h"
+ #include "BKE_material.h"
+ #include "BKE_mesh.h"
+ #include "BKE_node.h"
+ #include "BKE_node_tree_update.h"
+ #include "BKE_paint.h"
+ #include "BKE_screen.h"
+ #include "BKE_workspace.h"
+ 
+ #include "BLO_readfile.h"
+ 
+ #include "BLT_translation.h"
+ 
+ #include "versioning_common.h"
+ 
+ /* Make preferences read-only, use versioning_userdef.c. */
+ #define U (*((const UserDef *)&U))
+ 
+ static bool blo_is_builtin_template(const char *app_template)
+ {
+   /* For all builtin templates shipped with Blender. */
+   return (
+       !app_template ||
+       STR_ELEM(app_template, N_("2D_Animation"), N_("Sculpting"), N_("VFX"), N_("Video_Editing")));
+ }
+ 
+ static void blo_update_defaults_screen(bScreen *screen,
+                                        const char *app_template,
+                                        const char *workspace_name)
+ {
+   /* For all app templates. */
+   LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+     LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
+       /* Some toolbars have been saved as initialized,
+        * we don't want them to have odd zoom-level or scrolling set, see: T47047 */
+       if (ELEM(region->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS)) {
+         region->v2d.flag &= ~V2D_IS_INIT;
+       }
+     }
+ 
+     /* Set default folder. */
+     LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
+       if (sl->spacetype == SPACE_FILE) {
+         SpaceFile *sfile = (SpaceFile *)sl;
+         if (sfile->params) {
+           const char *dir_default = BKE_appdir_folder_default();
+           if (dir_default) {
+             STRNCPY(sfile->params->dir, dir_default);
+             sfile->params->file[0] = '\0';
+           }
+         }
+       }
+     }
+   }
+ 
+   /* For builtin templates only. */
+   if (!blo_is_builtin_template(app_template)) {
+     return;
+   }
+ 
+   LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+     LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
+       /* Remove all stored panels, we want to use defaults
+        * (order, open/closed) as defined by UI code here! */
+       BKE_area_region_panels_free(&region->panels);
+       BLI_freelistN(&region->panels_category_active);
+ 
+       /* Reset size so it uses consistent defaults from the region types. */
+       region->sizex = 0;
+       region->sizey = 0;
+     }
+ 
+     if (area->spacetype == SPACE_IMAGE) {
+       if (STREQ(workspace_name, "UV Editing")) {
+         SpaceImage *sima = static_cast<SpaceImage *>(area->spacedata.first);
+         if (sima->mode == SI_MODE_VIEW) {
+           sima->mode = SI_MODE_UV;
+         }
+       }
+     }
+     else if (area->spacetype == SPACE_ACTION) {
+       /* Show markers region, hide channels and collapse summary in timelines. */
+       SpaceAction *saction = static_cast<SpaceAction *>(area->spacedata.first);
+       saction->flag |= SACTION_SHOW_MARKERS;
+       if (saction->mode == SACTCONT_TIMELINE) {
+         saction->ads.flag |= ADS_FLAG_SUMMARY_COLLAPSED;
+ 
+         LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
+           if (region->regiontype == RGN_TYPE_CHANNELS) {
+             region->flag |= RGN_FLAG_HIDDEN;
+           }
+         }
+       }
+       else {
+         /* Open properties panel by default. */
+         LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
+           if (region->regiontype == RGN_TYPE_UI) {
+             region->flag &= ~RGN_FLAG_HIDDEN;
+           }
+         }
+       }
+     }
+     else if (area->spacetype == SPACE_GRAPH) {
+       SpaceGraph *sipo = static_cast<SpaceGraph *>(area->spacedata.first);
+       sipo->flag |= SIPO_SHOW_MARKERS;
+     }
+     else if (area->spacetype == SPACE_NLA) {
+       SpaceNla *snla = static_cast<SpaceNla *>(area->spacedata.first);
+       snla->flag |= SNLA_SHOW_MARKERS;
+     }
+     else if (area->spacetype == SPACE_SEQ) {
+       SpaceSeq *seq = static_cast<SpaceSeq *>(area->spacedata.first);
+       seq->flag |= SEQ_SHOW_MARKERS | SEQ_ZOOM_TO_FIT | SEQ_USE_PROXIES | SEQ_SHOW_OVERLAY;
+       seq->render_size = SEQ_RENDER_SIZE_PROXY_100;
+       seq->timeline_overlay.flag |= SEQ_TIMELINE_SHOW_STRIP_SOURCE | SEQ_TIMELINE_SHOW_STRIP_NAME |
+                                     SEQ_TIMELINE_SHOW_STRIP_DURATION | SEQ_TIMELINE_SHOW_GRID |
+                                     SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG;
+       seq->preview_overlay.flag |= SEQ_PREVIEW_SHOW_OUTLINE_SELECTED;
+     }
+     else if (area->spacetype == SPACE_TEXT) {
+       /* Show syntax and line numbers in Script workspace text editor. */
+       SpaceText *stext = static_cast<SpaceText *>(area->spacedata.first);
+       stext->showsyntax = true;
+       stext->showlinenrs = true;
+     }
+     else if (area->spacetype == SPACE_VIEW3D) {
+       View3D *v3d = static_cast<View3D *>(area->spacedata.first);
+       /*

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list