[Bf-blender-cvs] [5c660f0ff44] lanpr-under-gp: LineArt: Remove obsolete BKE_scene_ functions.

YimingWu noreply at git.blender.org
Mon Aug 3 14:20:39 CEST 2020


Commit: 5c660f0ff4445645cbf59d3f4e64da9ffd1684af
Author: YimingWu
Date:   Mon Aug 3 20:17:37 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB5c660f0ff4445645cbf59d3f4e64da9ffd1684af

LineArt: Remove obsolete BKE_scene_ functions.

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

M	source/blender/blenkernel/intern/scene.c

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

diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 5f80311d45d..069a606e04e 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -778,125 +778,6 @@ void BKE_toolsettings_free(ToolSettings *toolsettings)
   MEM_freeN(toolsettings);
 }
 
-/**
- * Only copy internal data of Scene ID from source
- * to already allocated/initialized destination.
- * You probably never want to use that directly,
- * use #BKE_id_copy or #BKE_id_copy_ex for typical needs.
- *
- * WARNING! This function will not handle ID user count!
- *
- * \param flag: Copying options (see BKE_library.h's LIB_ID_COPY_... flags for more).
- */
-void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, const int flag)
-{
-  /* We never handle usercount here for own data. */
-  const int flag_subdata = flag | LIB_ID_CREATE_NO_USER_REFCOUNT;
-  /* We always need allocation of our private ID data. */
-  const int flag_private_id_data = flag & ~LIB_ID_CREATE_NO_ALLOCATE;
-
-  sce_dst->ed = NULL;
-  sce_dst->depsgraph_hash = NULL;
-  sce_dst->fps_info = NULL;
-
-  /* Master Collection */
-  if (sce_src->master_collection) {
-    BKE_id_copy_ex(bmain,
-                   (ID *)sce_src->master_collection,
-                   (ID **)&sce_dst->master_collection,
-                   flag_private_id_data);
-  }
-
-  /* View Layers */
-  BLI_duplicatelist(&sce_dst->view_layers, &sce_src->view_layers);
-  for (ViewLayer *view_layer_src = sce_src->view_layers.first,
-                 *view_layer_dst = sce_dst->view_layers.first;
-       view_layer_src;
-       view_layer_src = view_layer_src->next, view_layer_dst = view_layer_dst->next) {
-    BKE_view_layer_copy_data(sce_dst, sce_src, view_layer_dst, view_layer_src, flag_subdata);
-  }
-
-  BLI_duplicatelist(&(sce_dst->markers), &(sce_src->markers));
-  BLI_duplicatelist(&(sce_dst->transform_spaces), &(sce_src->transform_spaces));
-  BLI_duplicatelist(&(sce_dst->r.views), &(sce_src->r.views));
-  BKE_keyingsets_copy(&(sce_dst->keyingsets), &(sce_src->keyingsets));
-
-  if (sce_src->nodetree) {
-    BKE_id_copy_ex(
-        bmain, (ID *)sce_src->nodetree, (ID **)&sce_dst->nodetree, flag_private_id_data);
-    BKE_libblock_relink_ex(bmain,
-                           sce_dst->nodetree,
-                           (void *)(&sce_src->id),
-                           &sce_dst->id,
-                           ID_REMAP_SKIP_NEVER_NULL_USAGE);
-  }
-
-  if (sce_src->rigidbody_world) {
-    sce_dst->rigidbody_world = BKE_rigidbody_world_copy(sce_src->rigidbody_world, flag_subdata);
-  }
-
-  /* copy color management settings */
-  BKE_color_managed_display_settings_copy(&sce_dst->display_settings, &sce_src->display_settings);
-  BKE_color_managed_view_settings_copy(&sce_dst->view_settings, &sce_src->view_settings);
-  BKE_color_managed_colorspace_settings_copy(&sce_dst->sequencer_colorspace_settings,
-                                             &sce_src->sequencer_colorspace_settings);
-
-  BKE_color_managed_display_settings_copy(&sce_dst->r.im_format.display_settings,
-                                          &sce_src->r.im_format.display_settings);
-  BKE_color_managed_view_settings_copy(&sce_dst->r.im_format.view_settings,
-                                       &sce_src->r.im_format.view_settings);
-
-  BKE_color_managed_display_settings_copy(&sce_dst->r.bake.im_format.display_settings,
-                                          &sce_src->r.bake.im_format.display_settings);
-  BKE_color_managed_view_settings_copy(&sce_dst->r.bake.im_format.view_settings,
-                                       &sce_src->r.bake.im_format.view_settings);
-
-  BKE_curvemapping_copy_data(&sce_dst->r.mblur_shutter_curve, &sce_src->r.mblur_shutter_curve);
-
-  /* tool settings */
-  sce_dst->toolsettings = BKE_toolsettings_copy(sce_dst->toolsettings, flag_subdata);
-
-  /* make a private copy of the avicodecdata */
-  if (sce_src->r.avicodecdata) {
-    sce_dst->r.avicodecdata = MEM_dupallocN(sce_src->r.avicodecdata);
-    sce_dst->r.avicodecdata->lpFormat = MEM_dupallocN(sce_dst->r.avicodecdata->lpFormat);
-    sce_dst->r.avicodecdata->lpParms = MEM_dupallocN(sce_dst->r.avicodecdata->lpParms);
-  }
-
-  if (sce_src->r.ffcodecdata.properties) {
-    /* intentionally check sce_dst not sce_src. */ /* XXX ??? comment outdated... */
-    sce_dst->r.ffcodecdata.properties = IDP_CopyProperty_ex(sce_src->r.ffcodecdata.properties,
-                                                            flag_subdata);
-  }
-
-  if (sce_src->display.shading.prop) {
-    sce_dst->display.shading.prop = IDP_CopyProperty(sce_src->display.shading.prop);
-  }
-
-  BKE_sound_reset_scene_runtime(sce_dst);
-
-  /* Copy sequencer, this is local data! */
-  if (sce_src->ed) {
-    sce_dst->ed = MEM_callocN(sizeof(*sce_dst->ed), __func__);
-    sce_dst->ed->seqbasep = &sce_dst->ed->seqbase;
-    BKE_sequence_base_dupli_recursive(sce_src,
-                                      sce_dst,
-                                      &sce_dst->ed->seqbase,
-                                      &sce_src->ed->seqbase,
-                                      SEQ_DUPE_ALL,
-                                      flag_subdata);
-  }
-
-  if ((flag & LIB_ID_COPY_NO_PREVIEW) == 0) {
-    BKE_previewimg_id_copy(&sce_dst->id, &sce_src->id);
-  }
-  else {
-    sce_dst->preview = NULL;
-  }
-
-  BKE_scene_copy_data_eevee(sce_dst, sce_src);
-}
-
 void BKE_scene_copy_data_eevee(Scene *sce_dst, const Scene *sce_src)
 {
   /* Copy eevee data between scenes. */
@@ -1066,273 +947,6 @@ void BKE_scene_groups_relink(Scene *sce)
   }
 }
 
-void BKE_scene_make_local(Main *bmain, Scene *sce, const bool lib_local)
-{
-  /* For now should work, may need more work though to support all possible corner cases
-   * (also scene_copy probably needs some love). */
-  BKE_lib_id_make_local(bmain, &sce->id, true, lib_local);
-}
-
-/** Free (or release) any data used by this scene (does not free the scene itself). */
-void BKE_scene_free_ex(Scene *sce, const bool do_id_user)
-{
-  BKE_animdata_free((ID *)sce, false);
-
-  BKE_sequencer_editing_free(sce, do_id_user);
-
-  BKE_keyingsets_free(&sce->keyingsets);
-
-  /* is no lib link block, but scene extension */
-  if (sce->nodetree) {
-    ntreeFreeEmbeddedTree(sce->nodetree);
-    MEM_freeN(sce->nodetree);
-    sce->nodetree = NULL;
-  }
-
-  if (sce->rigidbody_world) {
-    BKE_rigidbody_free_world(sce);
-  }
-
-  if (sce->r.avicodecdata) {
-    free_avicodecdata(sce->r.avicodecdata);
-    MEM_freeN(sce->r.avicodecdata);
-    sce->r.avicodecdata = NULL;
-  }
-  if (sce->r.ffcodecdata.properties) {
-    IDP_FreeProperty(sce->r.ffcodecdata.properties);
-    sce->r.ffcodecdata.properties = NULL;
-  }
-
-  BLI_freelistN(&sce->markers);
-  BLI_freelistN(&sce->transform_spaces);
-  BLI_freelistN(&sce->r.views);
-
-  BKE_toolsettings_free(sce->toolsettings);
-  sce->toolsettings = NULL;
-
-  BKE_scene_free_depsgraph_hash(sce);
-
-  MEM_SAFE_FREE(sce->fps_info);
-
-  BKE_sound_destroy_scene(sce);
-
-  BKE_color_managed_view_settings_free(&sce->view_settings);
-
-  BKE_previewimg_free(&sce->preview);
-  BKE_curvemapping_free_data(&sce->r.mblur_shutter_curve);
-
-  for (ViewLayer *view_layer = sce->view_layers.first, *view_layer_next; view_layer;
-       view_layer = view_layer_next) {
-    view_layer_next = view_layer->next;
-
-    BLI_remlink(&sce->view_layers, view_layer);
-    BKE_view_layer_free_ex(view_layer, do_id_user);
-  }
-
-  /* Master Collection */
-  // TODO: what to do with do_id_user? it's also true when just
-  // closing the file which seems wrong? should decrement users
-  // for objects directly in the master collection? then other
-  // collections in the scene need to do it too?
-  if (sce->master_collection) {
-    BKE_collection_free(sce->master_collection);
-    MEM_freeN(sce->master_collection);
-    sce->master_collection = NULL;
-  }
-
-  if (sce->eevee.light_cache) {
-    EEVEE_lightcache_free(sce->eevee.light_cache);
-    sce->eevee.light_cache = NULL;
-  }
-
-  if (sce->display.shading.prop) {
-    IDP_FreeProperty(sce->display.shading.prop);
-    sce->display.shading.prop = NULL;
-  }
-
-  /* These are freed on doversion. */
-  BLI_assert(sce->layer_properties == NULL);
-}
-
-void BKE_scene_free(Scene *sce)
-{
-  BKE_scene_free_ex(sce, true);
-}
-
-/**
- * \note Use DNA_scene_defaults.h where possible.
- */
-void BKE_scene_init(Scene *sce)
-{
-  const char *colorspace_name;
-  SceneRenderView *srv;
-  CurveMapping *mblur_shutter_curve;
-
-  BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(sce, id));
-
-  MEMCPY_STRUCT_AFTER(sce, DNA_struct_default_get(Scene), id);
-
-  BLI_strncpy(sce->r.bake.filepath, U.renderdir, sizeof(sce->r.bake.filepath));
-
-  mblur_shutter_curve = &sce->r.mblur_shutter_curve;
-  BKE_curvemapping_set_defaults(mblur_shutter_curve, 1, 0.0f, 0.0f, 1.0f, 1.0f);
-  BKE_curvemapping_initialize(mblur_shutter_curve);
-  BKE_curvemap_reset(mblur_shutter_curve->cm,
-                     &mblur_shutter_curve->clipr,
-                     CURVE_PRESET_MAX,
-                     CURVEMAP_SLOPE_POS_NEG);
-
-  sce->toolsettings = DNA_struct_default_alloc(ToolSettings);
-
-  sce->toolsettings->autokey_mode = U.autokey_mode;
-
-  /* grease pencil multiframe falloff curve */
-  sce->toolsettings->gp_sculpt.cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
-  CurveMapping *gp_falloff_curve = sce->toolsettings->gp_sculpt.cur_falloff;
-  BKE_curvemapping_initialize(gp_falloff_curve);
-  BKE_curvemap_reset(
-      gp_falloff_curve->cm, &gp_falloff_curve->clipr, CURVE_PRESET_GAUSS, CURVEMAP_SLOPE_POSITIVE);
-
-  sce->toolsettings->gp_sculpt.cur_primitive = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
-  CurveMapping *gp_primitive_curve = sce->toolsettings->gp_sculpt.cur_primitive;
-  BKE_curvemapping_initialize(gp_primitive_curve);
-  BKE_curvemap_reset(gp_primitive_curve->cm,
-                     &gp_primitive_curve->clipr,
-                     CURVE_PRESET_BELL,
-                     CURVEMAP_SLOPE_POSITIVE);
-
-  sce->unit.system = USER_UNIT_METRIC;
-  sce->unit.scale_length = 1.0f;
-  sce->unit.length_unit = bUnit_GetBaseUnitOfType(USER_UNIT_MET

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list