2011-11-05 13:11:49 +00:00
|
|
|
/*
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** \file blender/blenkernel/intern/lamp.c
|
|
|
|
* \ingroup bke
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
2012-11-09 13:57:09 +00:00
|
|
|
#include "DNA_anim_types.h"
|
2011-11-05 13:11:49 +00:00
|
|
|
#include "DNA_lamp_types.h"
|
|
|
|
#include "DNA_material_types.h"
|
2012-11-09 13:57:09 +00:00
|
|
|
#include "DNA_node_types.h"
|
2011-11-05 13:11:49 +00:00
|
|
|
#include "DNA_object_types.h"
|
2012-11-09 13:57:09 +00:00
|
|
|
#include "DNA_scene_types.h"
|
2011-11-05 13:11:49 +00:00
|
|
|
#include "DNA_texture_types.h"
|
|
|
|
|
|
|
|
#include "BLI_math.h"
|
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
|
|
|
#include "BKE_animsys.h"
|
|
|
|
#include "BKE_colortools.h"
|
|
|
|
#include "BKE_icons.h"
|
|
|
|
#include "BKE_global.h"
|
|
|
|
#include "BKE_lamp.h"
|
|
|
|
#include "BKE_library.h"
|
2016-07-10 16:15:03 +02:00
|
|
|
#include "BKE_library_query.h"
|
|
|
|
#include "BKE_library_remap.h"
|
2011-11-05 13:11:49 +00:00
|
|
|
#include "BKE_main.h"
|
|
|
|
#include "BKE_node.h"
|
|
|
|
|
First step to handle missing libs/datablocks when reading a file.
Idea is, instead of ignoring completely missing linked datablocks, to
create void placeholders for them.
That way, you can work on your file, save it, and find again your missing data once
lib becomes available again. Or you can edit missing lib's path (in Outliner),
save and reload the file, and you are done.
Also, Outliner now shows broken libraries (and placeholders) with a 'broken lib' icon.
Future plans are also to be able to relocate missing libs and reload them at runtime.
Code notes:
- Placeholder ID is just a regular datablock of same type as expected linked one,
with 'default' data, and a LIB_MISSING bitflag set.
- To allow creation of such datablocks, creation of datablocks in BKE was split in two step:
+ Allocation of memory itself.
+ Setting of all internal data to default values.
See also the design task (T43351).
Reviewed by @campbellbarton, thanks a bunch!
Differential Revision: https://developer.blender.org/D1394
2015-10-20 14:44:57 +02:00
|
|
|
void BKE_lamp_init(Lamp *la)
|
2011-11-05 13:11:49 +00:00
|
|
|
{
|
First step to handle missing libs/datablocks when reading a file.
Idea is, instead of ignoring completely missing linked datablocks, to
create void placeholders for them.
That way, you can work on your file, save it, and find again your missing data once
lib becomes available again. Or you can edit missing lib's path (in Outliner),
save and reload the file, and you are done.
Also, Outliner now shows broken libraries (and placeholders) with a 'broken lib' icon.
Future plans are also to be able to relocate missing libs and reload them at runtime.
Code notes:
- Placeholder ID is just a regular datablock of same type as expected linked one,
with 'default' data, and a LIB_MISSING bitflag set.
- To allow creation of such datablocks, creation of datablocks in BKE was split in two step:
+ Allocation of memory itself.
+ Setting of all internal data to default values.
See also the design task (T43351).
Reviewed by @campbellbarton, thanks a bunch!
Differential Revision: https://developer.blender.org/D1394
2015-10-20 14:44:57 +02:00
|
|
|
BLI_assert(MEMCMP_STRUCT_OFS_IS_ZERO(la, id));
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
la->r = la->g = la->b = la->k = 1.0f;
|
|
|
|
la->haint = la->energy = 1.0f;
|
|
|
|
la->dist = 25.0f;
|
Cleanup: Internal degrees removal.
This patch changes most of the reamining degrees usage in internal code into radians.
I let a few which I know off asside, for reasons explained below - and I'm not sure to have found out all of them.
WARNING: this introduces forward incompatibility, which means files saved from this version won't open 100% correctly
in previous versions (a few angle properties would use radians values as degrees...).
Details:
- Data:
-- Lamp.spotsize: Game engine exposed this setting in degrees, to not break the API here I kept it as such
(using getter/setter functions), still using radians internally.
-- Mesh.smoothresh: Didn't touch to this one, as we will hopefully replace it completely by loop normals currently in dev.
- Modifiers:
-- EdgeSplitModifierData.split_angle, BevelModifierData.bevel_angle: Done.
- Postprocessing:
-- WipeVars.angle (sequencer's effect), NodeBokehImage.angle, NodeBoxMask.rotation, NodeEllipseMask.rotation: Done.
- BGE:
-- bConstraintActuator: Orientation type done (the minloc[0] & maxloc[0] cases). Did not touch to 'limit location' type,
it can also limit rotation, but it exposes through RNA the same limit_min/limit_max, which hence
can be either distance or angle values, depending on the mode. Will leave this to BGE team.
-- bSoundActuator.cone_outer_angle_3d, bSoundActuator.cone_inner_angle_3d: Done (note I kept degrees in BGE itself,
as it seems this is the expected value here...).
-- bRadarSensor.angle: Done.
Reviewers: brecht, campbellbarton, sergey, gaiaclary, dfelinto, moguri, jbakker, lukastoenne, howardt
Reviewed By: brecht, campbellbarton, sergey, gaiaclary, moguri, jbakker, lukastoenne, howardt
Thanks to all!
Differential Revision: http://developer.blender.org/D59
2013-12-03 20:09:25 +01:00
|
|
|
la->spotsize = DEG2RADF(45.0f);
|
2012-05-06 15:15:33 +00:00
|
|
|
la->spotblend = 0.15f;
|
|
|
|
la->att2 = 1.0f;
|
|
|
|
la->mode = LA_SHAD_BUF;
|
|
|
|
la->bufsize = 512;
|
|
|
|
la->clipsta = 0.5f;
|
|
|
|
la->clipend = 40.0f;
|
|
|
|
la->samp = 3;
|
|
|
|
la->bias = 1.0f;
|
|
|
|
la->soft = 3.0f;
|
|
|
|
la->compressthresh = 0.05f;
|
|
|
|
la->ray_samp = la->ray_sampy = la->ray_sampz = 1;
|
2012-11-08 16:35:10 +00:00
|
|
|
la->area_size = la->area_sizey = la->area_sizez = 0.1f;
|
2012-05-06 15:15:33 +00:00
|
|
|
la->buffers = 1;
|
|
|
|
la->buftype = LA_SHADBUF_HALFWAY;
|
2011-11-05 13:11:49 +00:00
|
|
|
la->ray_samp_method = LA_SAMP_HALTON;
|
|
|
|
la->adapt_thresh = 0.001f;
|
2012-05-06 15:15:33 +00:00
|
|
|
la->preview = NULL;
|
2011-11-05 13:11:49 +00:00
|
|
|
la->falloff_type = LA_FALLOFF_INVSQUARE;
|
2016-03-13 02:00:12 +01:00
|
|
|
la->coeff_const = 1.0f;
|
|
|
|
la->coeff_lin = 0.0f;
|
|
|
|
la->coeff_quad = 0.0f;
|
2011-11-05 13:11:49 +00:00
|
|
|
la->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
|
|
|
|
la->sun_effect_type = 0;
|
|
|
|
la->horizon_brightness = 1.0;
|
|
|
|
la->spread = 1.0;
|
|
|
|
la->sun_brightness = 1.0;
|
|
|
|
la->sun_size = 1.0;
|
|
|
|
la->backscattered_light = 1.0f;
|
|
|
|
la->atm_turbidity = 2.0f;
|
|
|
|
la->atm_inscattering_factor = 1.0f;
|
|
|
|
la->atm_extinction_factor = 1.0f;
|
|
|
|
la->atm_distance_factor = 1.0f;
|
|
|
|
la->sun_intensity = 1.0f;
|
2012-05-06 15:15:33 +00:00
|
|
|
la->skyblendtype = MA_RAMP_ADD;
|
|
|
|
la->skyblendfac = 1.0f;
|
|
|
|
la->sky_colorspace = BLI_XYZ_CIE;
|
|
|
|
la->sky_exposure = 1.0f;
|
|
|
|
la->shadow_frustum_size = 10.0f;
|
2011-11-05 13:11:49 +00:00
|
|
|
|
|
|
|
curvemapping_initialize(la->curfalloff);
|
First step to handle missing libs/datablocks when reading a file.
Idea is, instead of ignoring completely missing linked datablocks, to
create void placeholders for them.
That way, you can work on your file, save it, and find again your missing data once
lib becomes available again. Or you can edit missing lib's path (in Outliner),
save and reload the file, and you are done.
Also, Outliner now shows broken libraries (and placeholders) with a 'broken lib' icon.
Future plans are also to be able to relocate missing libs and reload them at runtime.
Code notes:
- Placeholder ID is just a regular datablock of same type as expected linked one,
with 'default' data, and a LIB_MISSING bitflag set.
- To allow creation of such datablocks, creation of datablocks in BKE was split in two step:
+ Allocation of memory itself.
+ Setting of all internal data to default values.
See also the design task (T43351).
Reviewed by @campbellbarton, thanks a bunch!
Differential Revision: https://developer.blender.org/D1394
2015-10-20 14:44:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Lamp *BKE_lamp_add(Main *bmain, const char *name)
|
|
|
|
{
|
|
|
|
Lamp *la;
|
|
|
|
|
|
|
|
la = BKE_libblock_alloc(bmain, ID_LA, name);
|
|
|
|
|
|
|
|
BKE_lamp_init(la);
|
|
|
|
|
2011-11-05 13:11:49 +00:00
|
|
|
return la;
|
|
|
|
}
|
|
|
|
|
2016-07-10 14:52:00 +02:00
|
|
|
Lamp *BKE_lamp_copy(Main *bmain, Lamp *la)
|
2011-11-05 13:11:49 +00:00
|
|
|
{
|
|
|
|
Lamp *lan;
|
|
|
|
int a;
|
|
|
|
|
2016-07-10 14:52:00 +02:00
|
|
|
lan = BKE_libblock_copy(bmain, &la->id);
|
2011-11-05 13:11:49 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
for (a = 0; a < MAX_MTEX; a++) {
|
2012-03-24 06:18:31 +00:00
|
|
|
if (lan->mtex[a]) {
|
2012-05-06 15:15:33 +00:00
|
|
|
lan->mtex[a] = MEM_mallocN(sizeof(MTex), "copylamptex");
|
2011-11-05 13:11:49 +00:00
|
|
|
memcpy(lan->mtex[a], la->mtex[a], sizeof(MTex));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
lan->curfalloff = curvemapping_copy(la->curfalloff);
|
|
|
|
|
2012-03-24 06:18:31 +00:00
|
|
|
if (la->nodetree)
|
2016-07-10 14:52:00 +02:00
|
|
|
lan->nodetree = ntreeCopyTree(bmain, la->nodetree);
|
2011-11-05 13:11:49 +00:00
|
|
|
|
2016-07-11 19:13:42 +02:00
|
|
|
lan->preview = BKE_previewimg_copy(la->preview);
|
|
|
|
|
|
|
|
BKE_id_expand_local(&lan->id, true);
|
|
|
|
|
2016-07-06 14:11:01 +02:00
|
|
|
if (ID_IS_LINKED_DATABLOCK(la)) {
|
2016-07-10 14:52:00 +02:00
|
|
|
BKE_id_lib_local_paths(bmain, la->id.lib, &lan->id);
|
2015-01-09 09:52:51 +01:00
|
|
|
}
|
|
|
|
|
2011-11-05 13:11:49 +00:00
|
|
|
return lan;
|
|
|
|
}
|
|
|
|
|
|
|
|
Lamp *localize_lamp(Lamp *la)
|
|
|
|
{
|
|
|
|
Lamp *lan;
|
|
|
|
int a;
|
|
|
|
|
2014-09-29 15:05:02 +06:00
|
|
|
lan = BKE_libblock_copy_nolib(&la->id, false);
|
2011-11-05 13:11:49 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
for (a = 0; a < MAX_MTEX; a++) {
|
2012-03-24 06:18:31 +00:00
|
|
|
if (lan->mtex[a]) {
|
2012-05-06 15:15:33 +00:00
|
|
|
lan->mtex[a] = MEM_mallocN(sizeof(MTex), "localize_lamp");
|
2011-11-05 13:11:49 +00:00
|
|
|
memcpy(lan->mtex[a], la->mtex[a], sizeof(MTex));
|
|
|
|
/* free lamp decrements */
|
|
|
|
id_us_plus((ID *)lan->mtex[a]->tex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
lan->curfalloff = curvemapping_copy(la->curfalloff);
|
|
|
|
|
2012-03-24 06:18:31 +00:00
|
|
|
if (la->nodetree)
|
2012-05-06 15:15:33 +00:00
|
|
|
lan->nodetree = ntreeLocalize(la->nodetree);
|
2011-11-05 13:11:49 +00:00
|
|
|
|
2016-07-11 19:13:42 +02:00
|
|
|
lan->preview = NULL;
|
2016-07-11 16:50:59 +02:00
|
|
|
|
2011-11-05 13:11:49 +00:00
|
|
|
return lan;
|
|
|
|
}
|
|
|
|
|
2016-07-10 16:15:03 +02:00
|
|
|
void BKE_lamp_make_local(Main *bmain, Lamp *la)
|
2011-11-05 13:11:49 +00:00
|
|
|
{
|
2014-04-01 11:34:00 +11:00
|
|
|
bool is_local = false, is_lib = false;
|
2011-11-05 13:11:49 +00:00
|
|
|
|
|
|
|
/* - only lib users: do nothing
|
2012-03-03 20:19:11 +00:00
|
|
|
* - only local users: set flag
|
|
|
|
* - mixed: make copy
|
|
|
|
*/
|
2011-11-05 13:11:49 +00:00
|
|
|
|
2016-07-10 16:15:03 +02:00
|
|
|
if (!ID_IS_LINKED_DATABLOCK(la)) {
|
2011-11-05 13:11:49 +00:00
|
|
|
return;
|
|
|
|
}
|
2016-07-10 16:15:03 +02:00
|
|
|
|
|
|
|
BKE_library_ID_test_usages(bmain, la, &is_local, &is_lib);
|
|
|
|
|
|
|
|
if (is_local) {
|
|
|
|
if (!is_lib) {
|
|
|
|
id_clear_lib_data(bmain, &la->id);
|
2016-07-11 19:13:42 +02:00
|
|
|
BKE_id_expand_local(&la->id, false);
|
2011-11-05 13:11:49 +00:00
|
|
|
}
|
2016-07-10 16:15:03 +02:00
|
|
|
else {
|
|
|
|
Lamp *la_new = BKE_lamp_copy(bmain, la);
|
|
|
|
|
|
|
|
la_new->id.us = 0;
|
|
|
|
|
|
|
|
/* Remap paths of new ID using old library as base. */
|
|
|
|
BKE_id_lib_local_paths(bmain, la->id.lib, &la_new->id);
|
|
|
|
|
|
|
|
BKE_libblock_remap(bmain, la, la_new, ID_REMAP_SKIP_INDIRECT_USAGE);
|
2011-11-05 13:11:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-05 14:03:12 +00:00
|
|
|
void BKE_lamp_free(Lamp *la)
|
2011-11-05 13:11:49 +00:00
|
|
|
{
|
|
|
|
MTex *mtex;
|
|
|
|
int a;
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
for (a = 0; a < MAX_MTEX; a++) {
|
|
|
|
mtex = la->mtex[a];
|
2015-11-09 19:47:10 +01:00
|
|
|
if (mtex && mtex->tex)
|
|
|
|
id_us_min(&mtex->tex->id);
|
|
|
|
if (mtex)
|
|
|
|
MEM_freeN(mtex);
|
2011-11-05 13:11:49 +00:00
|
|
|
}
|
|
|
|
|
ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).
This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing
processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock
was pretty much impossible, except for a few special cases.
Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite
a few ID usages were missed or wrongly handled that way).
One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling
by using library_query utils to allow generic handling of those, which is now the case
(now, generic ID links handling is only "knwon" from readfile.c and library_query.c).
This commit also adds backends to allow live replacement and deletion of datablocks in Blender
(so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one,
or NULL one in case of unlinking).
This will allow nice new features, like ability to easily reload or relocate libraries, real immediate
deletion of datablocks in blender, replacement of one datablock by another, etc.
Some of those are for next commits.
A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core.
Though it was tested rather deeply, being totally impossible to check all possible ID usage cases,
it's likely there are some remaining issues and bugs in new code... Please report them! ;)
Review task: D2027 (https://developer.blender.org/D2027).
Reviewed by campbellbarton, thanks a bunch.
2016-06-22 17:29:38 +02:00
|
|
|
BKE_animdata_free((ID *)la, false);
|
2011-11-05 13:11:49 +00:00
|
|
|
|
|
|
|
curvemapping_free(la->curfalloff);
|
|
|
|
|
|
|
|
/* is no lib link block, but lamp extension */
|
2012-03-24 06:18:31 +00:00
|
|
|
if (la->nodetree) {
|
2012-08-22 09:35:46 +00:00
|
|
|
ntreeFreeTree(la->nodetree);
|
2011-11-05 13:11:49 +00:00
|
|
|
MEM_freeN(la->nodetree);
|
|
|
|
}
|
|
|
|
|
|
|
|
BKE_previewimg_free(&la->preview);
|
2015-05-11 16:29:12 +02:00
|
|
|
BKE_icon_id_delete(&la->id);
|
2011-11-05 13:11:49 +00:00
|
|
|
la->id.icon_id = 0;
|
|
|
|
}
|
|
|
|
|
2012-11-09 13:57:09 +00:00
|
|
|
/* Calculate all drivers for lamps, see material_drivers_update for why this is a bad hack */
|
|
|
|
|
|
|
|
static void lamp_node_drivers_update(Scene *scene, bNodeTree *ntree, float ctime)
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
|
|
|
|
/* nodetree itself */
|
|
|
|
if (ntree->adt && ntree->adt->drivers.first)
|
|
|
|
BKE_animsys_evaluate_animdata(scene, &ntree->id, ntree->adt, ctime, ADT_RECALC_DRIVERS);
|
|
|
|
|
|
|
|
/* nodes */
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next)
|
|
|
|
if (node->id && node->type == NODE_GROUP)
|
|
|
|
lamp_node_drivers_update(scene, (bNodeTree *)node->id, ctime);
|
|
|
|
}
|
|
|
|
|
|
|
|
void lamp_drivers_update(Scene *scene, Lamp *la, float ctime)
|
|
|
|
{
|
|
|
|
/* Prevent infinite recursion by checking (and tagging the lamp) as having been visited already
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
* (see BKE_scene_update_tagged()). This assumes la->id.tag & LIB_TAG_DOIT isn't set by anything else
|
2012-11-09 13:57:09 +00:00
|
|
|
* in the meantime... [#32017] */
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
if (la->id.tag & LIB_TAG_DOIT)
|
2012-11-09 13:57:09 +00:00
|
|
|
return;
|
2013-05-12 13:33:20 +00:00
|
|
|
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
la->id.tag |= LIB_TAG_DOIT;
|
2012-11-09 13:57:09 +00:00
|
|
|
|
|
|
|
/* lamp itself */
|
|
|
|
if (la->adt && la->adt->drivers.first)
|
|
|
|
BKE_animsys_evaluate_animdata(scene, &la->id, la->adt, ctime, ADT_RECALC_DRIVERS);
|
|
|
|
|
|
|
|
/* nodes */
|
|
|
|
if (la->nodetree)
|
|
|
|
lamp_node_drivers_update(scene, la->nodetree, ctime);
|
2013-05-12 13:33:20 +00:00
|
|
|
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
la->id.tag &= ~LIB_TAG_DOIT;
|
2012-11-09 13:57:09 +00:00
|
|
|
}
|
|
|
|
|