2013-11-29 23:16:13 +06:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup blenloader
|
2013-11-29 23:16:13 +06:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
|
|
|
/* allow readfile to use deprecated functionality */
|
|
|
|
#define DNA_DEPRECATED_ALLOW
|
|
|
|
|
|
|
|
#include "DNA_anim_types.h"
|
|
|
|
#include "DNA_brush_types.h"
|
|
|
|
#include "DNA_camera_types.h"
|
|
|
|
#include "DNA_cloth_types.h"
|
|
|
|
#include "DNA_constraint_types.h"
|
|
|
|
#include "DNA_genfile.h"
|
|
|
|
#include "DNA_key_types.h"
|
|
|
|
#include "DNA_linestyle_types.h"
|
|
|
|
#include "DNA_mesh_types.h"
|
|
|
|
#include "DNA_meshdata_types.h"
|
2018-02-07 11:14:08 +11:00
|
|
|
#include "DNA_object_fluidsim_types.h"
|
2013-11-29 23:16:13 +06:00
|
|
|
#include "DNA_object_types.h"
|
|
|
|
#include "DNA_text_types.h"
|
|
|
|
#include "DNA_view3d_types.h"
|
|
|
|
#include "DNA_screen_types.h"
|
|
|
|
#include "DNA_sdna_types.h"
|
|
|
|
#include "DNA_smoke_types.h"
|
|
|
|
#include "DNA_space_types.h"
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
#include "BLI_blenlib.h"
|
|
|
|
#include "BLI_math.h"
|
2017-01-16 17:33:34 +01:00
|
|
|
#include "BLI_string_utils.h"
|
2013-11-29 23:16:13 +06:00
|
|
|
|
2015-08-16 17:32:01 +10:00
|
|
|
#include "BLT_translation.h"
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
#include "BKE_anim.h"
|
|
|
|
#include "BKE_image.h"
|
|
|
|
#include "BKE_main.h" // for Main
|
|
|
|
#include "BKE_mesh.h" // for ME_ defines (patching)
|
|
|
|
#include "BKE_modifier.h"
|
|
|
|
#include "BKE_particle.h"
|
|
|
|
#include "BKE_pointcache.h"
|
|
|
|
#include "BKE_scene.h"
|
|
|
|
#include "BKE_screen.h"
|
|
|
|
#include "BKE_sequencer.h"
|
|
|
|
#include "BKE_text.h" // for txt_extended_ascii_as_utf8
|
|
|
|
#include "BKE_texture.h"
|
|
|
|
#include "BKE_tracking.h"
|
|
|
|
#include "BKE_writeffmpeg.h"
|
|
|
|
|
|
|
|
#include "IMB_imbuf.h" // for proxy / timecode versioning stuff
|
|
|
|
|
|
|
|
#include "NOD_texture.h"
|
|
|
|
|
|
|
|
#include "BLO_readfile.h"
|
|
|
|
|
|
|
|
#include "readfile.h"
|
|
|
|
|
|
|
|
static void do_versions_nodetree_image_default_alpha_output(bNodeTree *ntree)
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (ELEM(node->type, CMP_NODE_IMAGE, CMP_NODE_R_LAYERS)) {
|
|
|
|
/* default Image output value should have 0 alpha */
|
|
|
|
sock = node->outputs.first;
|
|
|
|
((bNodeSocketValueRGBA *)(sock->default_value))->value[3] = 0.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void do_versions_nodetree_convert_angle(bNodeTree *ntree)
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_ROTATE) {
|
|
|
|
/* Convert degrees to radians. */
|
|
|
|
bNodeSocket *sock = ((bNodeSocket *)node->inputs.first)->next;
|
|
|
|
((bNodeSocketValueFloat *)sock->default_value)->value =
|
|
|
|
DEG2RADF(((bNodeSocketValueFloat *)sock->default_value)->value);
|
|
|
|
}
|
|
|
|
else if (node->type == CMP_NODE_DBLUR) {
|
|
|
|
/* Convert degrees to radians. */
|
|
|
|
NodeDBlurData *ndbd = node->storage;
|
|
|
|
ndbd->angle = DEG2RADF(ndbd->angle);
|
|
|
|
ndbd->spin = DEG2RADF(ndbd->spin);
|
|
|
|
}
|
|
|
|
else if (node->type == CMP_NODE_DEFOCUS) {
|
|
|
|
/* Convert degrees to radians. */
|
|
|
|
NodeDefocus *nqd = node->storage;
|
|
|
|
/* XXX DNA char to float conversion seems to map the char value into the [0.0f, 1.0f] range... */
|
|
|
|
nqd->rotation = DEG2RADF(nqd->rotation * 255.0f);
|
|
|
|
}
|
|
|
|
else if (node->type == CMP_NODE_CHROMA_MATTE) {
|
|
|
|
/* Convert degrees to radians. */
|
|
|
|
NodeChroma *ndc = node->storage;
|
|
|
|
ndc->t1 = DEG2RADF(ndc->t1);
|
|
|
|
ndc->t2 = DEG2RADF(ndc->t2);
|
|
|
|
}
|
|
|
|
else if (node->type == CMP_NODE_GLARE) {
|
|
|
|
/* Convert degrees to radians. */
|
|
|
|
NodeGlare *ndg = node->storage;
|
|
|
|
/* XXX DNA char to float conversion seems to map the char value into the [0.0f, 1.0f] range... */
|
|
|
|
ndg->angle_ofs = DEG2RADF(ndg->angle_ofs * 255.0f);
|
|
|
|
}
|
|
|
|
/* XXX TexMapping struct is used by other nodes too (at least node_composite_mapValue),
|
|
|
|
* but not the rot part...
|
|
|
|
*/
|
|
|
|
else if (node->type == SH_NODE_MAPPING) {
|
|
|
|
/* Convert degrees to radians. */
|
|
|
|
TexMapping *tmap = node->storage;
|
|
|
|
tmap->rot[0] = DEG2RADF(tmap->rot[0]);
|
|
|
|
tmap->rot[1] = DEG2RADF(tmap->rot[1]);
|
|
|
|
tmap->rot[2] = DEG2RADF(tmap->rot[2]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void do_versions_image_settings_2_60(Scene *sce)
|
|
|
|
{
|
|
|
|
/* note: rd->subimtype is moved into individual settings now and no longer
|
|
|
|
* exists */
|
|
|
|
RenderData *rd = &sce->r;
|
|
|
|
ImageFormatData *imf = &sce->r.im_format;
|
|
|
|
|
|
|
|
/* we know no data loss happens here, the old values were in char range */
|
|
|
|
imf->imtype = (char)rd->imtype;
|
|
|
|
imf->planes = (char)rd->planes;
|
|
|
|
imf->compress = (char)rd->quality;
|
|
|
|
imf->quality = (char)rd->quality;
|
|
|
|
|
|
|
|
/* default, was stored in multiple places, may override later */
|
|
|
|
imf->depth = R_IMF_CHAN_DEPTH_8;
|
|
|
|
|
|
|
|
/* openexr */
|
|
|
|
imf->exr_codec = rd->quality & 7; /* strange but true! 0-4 are valid values, OPENEXR_COMPRESS */
|
|
|
|
|
|
|
|
switch (imf->imtype) {
|
|
|
|
case R_IMF_IMTYPE_OPENEXR:
|
|
|
|
imf->depth = (rd->subimtype & R_OPENEXR_HALF) ? R_IMF_CHAN_DEPTH_16 : R_IMF_CHAN_DEPTH_32;
|
|
|
|
if (rd->subimtype & R_PREVIEW_JPG) {
|
|
|
|
imf->flag |= R_IMF_FLAG_PREVIEW_JPG;
|
|
|
|
}
|
|
|
|
if (rd->subimtype & R_OPENEXR_ZBUF) {
|
|
|
|
imf->flag |= R_IMF_FLAG_ZBUF;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case R_IMF_IMTYPE_TIFF:
|
|
|
|
if (rd->subimtype & R_TIFF_16BIT) {
|
|
|
|
imf->depth = R_IMF_CHAN_DEPTH_16;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case R_IMF_IMTYPE_JP2:
|
|
|
|
if (rd->subimtype & R_JPEG2K_16BIT) {
|
|
|
|
imf->depth = R_IMF_CHAN_DEPTH_16;
|
|
|
|
}
|
|
|
|
else if (rd->subimtype & R_JPEG2K_12BIT) {
|
|
|
|
imf->depth = R_IMF_CHAN_DEPTH_12;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rd->subimtype & R_JPEG2K_YCC) {
|
|
|
|
imf->jp2_flag |= R_IMF_JP2_FLAG_YCC;
|
|
|
|
}
|
|
|
|
if (rd->subimtype & R_JPEG2K_CINE_PRESET) {
|
|
|
|
imf->jp2_flag |= R_IMF_JP2_FLAG_CINE_PRESET;
|
|
|
|
}
|
|
|
|
if (rd->subimtype & R_JPEG2K_CINE_48FPS) {
|
|
|
|
imf->jp2_flag |= R_IMF_JP2_FLAG_CINE_48;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case R_IMF_IMTYPE_CINEON:
|
|
|
|
case R_IMF_IMTYPE_DPX:
|
|
|
|
if (rd->subimtype & R_CINEON_LOG) {
|
|
|
|
imf->cineon_flag |= R_IMF_CINEON_FLAG_LOG;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* socket use flags were only temporary before */
|
|
|
|
static void do_versions_nodetree_socket_use_flags_2_62(bNodeTree *ntree)
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
bNodeSocket *sock;
|
|
|
|
bNodeLink *link;
|
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
for (sock = node->inputs.first; sock; sock = sock->next)
|
|
|
|
sock->flag &= ~SOCK_IN_USE;
|
|
|
|
for (sock = node->outputs.first; sock; sock = sock->next)
|
|
|
|
sock->flag &= ~SOCK_IN_USE;
|
|
|
|
}
|
|
|
|
for (sock = ntree->inputs.first; sock; sock = sock->next)
|
|
|
|
sock->flag &= ~SOCK_IN_USE;
|
|
|
|
for (sock = ntree->outputs.first; sock; sock = sock->next)
|
|
|
|
sock->flag &= ~SOCK_IN_USE;
|
|
|
|
|
|
|
|
for (link = ntree->links.first; link; link = link->next) {
|
|
|
|
link->fromsock->flag |= SOCK_IN_USE;
|
|
|
|
link->tosock->flag |= SOCK_IN_USE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void do_versions_nodetree_multi_file_output_format_2_62_1(Scene *sce, bNodeTree *ntree)
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_OUTPUT_FILE) {
|
|
|
|
/* previous CMP_NODE_OUTPUT_FILE nodes get converted to multi-file outputs */
|
|
|
|
NodeImageFile *old_data = node->storage;
|
|
|
|
NodeImageMultiFile *nimf = MEM_callocN(sizeof(NodeImageMultiFile), "node image multi file");
|
|
|
|
bNodeSocket *old_image = BLI_findlink(&node->inputs, 0);
|
|
|
|
bNodeSocket *old_z = BLI_findlink(&node->inputs, 1);
|
|
|
|
bNodeSocket *sock;
|
|
|
|
char filename[FILE_MAXFILE];
|
|
|
|
|
|
|
|
/* ugly, need to remove the old inputs list to avoid bad pointer checks when adding new sockets.
|
|
|
|
* sock->storage is expected to contain path info in ntreeCompositOutputFileAddSocket.
|
|
|
|
*/
|
2014-02-08 06:07:10 +11:00
|
|
|
BLI_listbase_clear(&node->inputs);
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
node->storage = nimf;
|
|
|
|
|
|
|
|
/* looks like storage data can be messed up somehow, stupid check here */
|
|
|
|
if (old_data) {
|
|
|
|
char basepath[FILE_MAXDIR];
|
|
|
|
|
|
|
|
/* split off filename from the old path, to be used as socket sub-path */
|
|
|
|
BLI_split_dirfile(old_data->name, basepath, filename, sizeof(basepath), sizeof(filename));
|
|
|
|
|
|
|
|
BLI_strncpy(nimf->base_path, basepath, sizeof(nimf->base_path));
|
|
|
|
nimf->format = old_data->im_format;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
BLI_strncpy(filename, old_image->name, sizeof(filename));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if z buffer is saved, change the image type to multilayer exr.
|
|
|
|
* XXX this is slightly messy, Z buffer was ignored before for anything but EXR and IRIS ...
|
|
|
|
* i'm just assuming here that IRIZ means IRIS with z buffer ...
|
|
|
|
*/
|
|
|
|
if (old_data && ELEM(old_data->im_format.imtype, R_IMF_IMTYPE_IRIZ, R_IMF_IMTYPE_OPENEXR)) {
|
|
|
|
char sockpath[FILE_MAX];
|
|
|
|
|
|
|
|
nimf->format.imtype = R_IMF_IMTYPE_MULTILAYER;
|
|
|
|
|
|
|
|
BLI_snprintf(sockpath, sizeof(sockpath), "%s_Image", filename);
|
|
|
|
sock = ntreeCompositOutputFileAddSocket(ntree, node, sockpath, &nimf->format);
|
2015-07-06 14:18:03 +10:00
|
|
|
/* XXX later do_versions copies path from socket name, need to set this explicitly */
|
2013-11-29 23:16:13 +06:00
|
|
|
BLI_strncpy(sock->name, sockpath, sizeof(sock->name));
|
|
|
|
if (old_image->link) {
|
|
|
|
old_image->link->tosock = sock;
|
|
|
|
sock->link = old_image->link;
|
|
|
|
}
|
|
|
|
|
|
|
|
BLI_snprintf(sockpath, sizeof(sockpath), "%s_Z", filename);
|
|
|
|
sock = ntreeCompositOutputFileAddSocket(ntree, node, sockpath, &nimf->format);
|
2015-07-06 14:18:03 +10:00
|
|
|
/* XXX later do_versions copies path from socket name, need to set this explicitly */
|
2013-11-29 23:16:13 +06:00
|
|
|
BLI_strncpy(sock->name, sockpath, sizeof(sock->name));
|
|
|
|
if (old_z->link) {
|
|
|
|
old_z->link->tosock = sock;
|
|
|
|
sock->link = old_z->link;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
sock = ntreeCompositOutputFileAddSocket(ntree, node, filename, &nimf->format);
|
2015-07-06 14:18:03 +10:00
|
|
|
/* XXX later do_versions copies path from socket name, need to set this explicitly */
|
2013-11-29 23:16:13 +06:00
|
|
|
BLI_strncpy(sock->name, filename, sizeof(sock->name));
|
|
|
|
if (old_image->link) {
|
|
|
|
old_image->link->tosock = sock;
|
|
|
|
sock->link = old_image->link;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
nodeRemoveSocket(ntree, node, old_image);
|
|
|
|
nodeRemoveSocket(ntree, node, old_z);
|
|
|
|
if (old_data)
|
|
|
|
MEM_freeN(old_data);
|
|
|
|
}
|
|
|
|
else if (node->type == CMP_NODE_OUTPUT_MULTI_FILE__DEPRECATED) {
|
|
|
|
NodeImageMultiFile *nimf = node->storage;
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
|
|
|
/* CMP_NODE_OUTPUT_MULTI_FILE has been redeclared as CMP_NODE_OUTPUT_FILE */
|
|
|
|
node->type = CMP_NODE_OUTPUT_FILE;
|
|
|
|
|
|
|
|
/* initialize the node-wide image format from render data, if available */
|
|
|
|
if (sce)
|
|
|
|
nimf->format = sce->r.im_format;
|
|
|
|
|
|
|
|
/* transfer render format toggle to node format toggle */
|
|
|
|
for (sock = node->inputs.first; sock; sock = sock->next) {
|
|
|
|
NodeImageMultiFileSocket *simf = sock->storage;
|
|
|
|
simf->use_node_format = simf->use_render_format;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we do have preview now */
|
|
|
|
node->flag |= NODE_PREVIEW;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* blue and red are swapped pre 2.62.1, be sane (red == red) now! */
|
|
|
|
static void do_versions_mesh_mloopcol_swap_2_62_1(Mesh *me)
|
|
|
|
{
|
|
|
|
CustomDataLayer *layer;
|
|
|
|
MLoopCol *mloopcol;
|
|
|
|
int a;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (a = 0; a < me->ldata.totlayer; a++) {
|
|
|
|
layer = &me->ldata.layers[a];
|
|
|
|
|
|
|
|
if (layer->type == CD_MLOOPCOL) {
|
|
|
|
mloopcol = (MLoopCol *)layer->data;
|
|
|
|
for (i = 0; i < me->totloop; i++, mloopcol++) {
|
2018-11-30 14:51:16 +11:00
|
|
|
SWAP(uchar, mloopcol->r, mloopcol->b);
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void do_versions_nodetree_multi_file_output_path_2_63_1(bNodeTree *ntree)
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_OUTPUT_FILE) {
|
|
|
|
bNodeSocket *sock;
|
|
|
|
for (sock = node->inputs.first; sock; sock = sock->next) {
|
|
|
|
NodeImageMultiFileSocket *input = sock->storage;
|
|
|
|
/* input file path is stored in dedicated struct now instead socket name */
|
|
|
|
BLI_strncpy(input->path, sock->name, sizeof(input->path));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void do_versions_nodetree_file_output_layers_2_64_5(bNodeTree *ntree)
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_OUTPUT_FILE) {
|
|
|
|
bNodeSocket *sock;
|
|
|
|
for (sock = node->inputs.first; sock; sock = sock->next) {
|
|
|
|
NodeImageMultiFileSocket *input = sock->storage;
|
|
|
|
|
|
|
|
/* multilayer names are stored as separate strings now,
|
|
|
|
* used the path string before, so copy it over.
|
|
|
|
*/
|
|
|
|
BLI_strncpy(input->layer, input->path, sizeof(input->layer));
|
|
|
|
|
|
|
|
/* paths/layer names also have to be unique now, initial check */
|
|
|
|
ntreeCompositOutputFileUniquePath(&node->inputs, sock, input->path, '_');
|
|
|
|
ntreeCompositOutputFileUniqueLayer(&node->inputs, sock, input->layer, '_');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void do_versions_nodetree_image_layer_2_64_5(bNodeTree *ntree)
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_IMAGE) {
|
|
|
|
bNodeSocket *sock;
|
|
|
|
for (sock = node->outputs.first; sock; sock = sock->next) {
|
|
|
|
NodeImageLayer *output = MEM_callocN(sizeof(NodeImageLayer), "node image layer");
|
|
|
|
|
|
|
|
/* take pass index both from current storage ptr (actually an int) */
|
2018-09-19 12:05:58 +10:00
|
|
|
output->pass_index = POINTER_AS_INT(sock->storage);
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
/* replace socket data pointer */
|
|
|
|
sock->storage = output;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void do_versions_nodetree_frame_2_64_6(bNodeTree *ntree)
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == NODE_FRAME) {
|
|
|
|
/* initialize frame node storage data */
|
|
|
|
if (node->storage == NULL) {
|
|
|
|
NodeFrame *data = (NodeFrame *)MEM_callocN(sizeof(NodeFrame), "frame node storage");
|
|
|
|
node->storage = data;
|
|
|
|
|
|
|
|
/* copy current flags */
|
|
|
|
data->flag = node->custom1;
|
|
|
|
|
|
|
|
data->label_size = 20;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize custom node color */
|
2018-11-30 14:51:16 +11:00
|
|
|
node->color[0] = node->color[1] = node->color[2] = 0.608f; /* default theme color */
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void do_versions_affine_tracker_track(MovieTrackingTrack *track)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < track->markersnr; i++) {
|
|
|
|
MovieTrackingMarker *marker = &track->markers[i];
|
|
|
|
|
|
|
|
if (is_zero_v2(marker->pattern_corners[0]) && is_zero_v2(marker->pattern_corners[1]) &&
|
|
|
|
is_zero_v2(marker->pattern_corners[2]) && is_zero_v2(marker->pattern_corners[3]))
|
2016-01-21 09:05:52 +11:00
|
|
|
{
|
|
|
|
marker->pattern_corners[0][0] = track->pat_min[0];
|
|
|
|
marker->pattern_corners[0][1] = track->pat_min[1];
|
2013-11-29 23:16:13 +06:00
|
|
|
|
2016-01-21 09:05:52 +11:00
|
|
|
marker->pattern_corners[1][0] = track->pat_max[0];
|
|
|
|
marker->pattern_corners[1][1] = track->pat_min[1];
|
2013-11-29 23:16:13 +06:00
|
|
|
|
2016-01-21 09:05:52 +11:00
|
|
|
marker->pattern_corners[2][0] = track->pat_max[0];
|
|
|
|
marker->pattern_corners[2][1] = track->pat_max[1];
|
2013-11-29 23:16:13 +06:00
|
|
|
|
2016-01-21 09:05:52 +11:00
|
|
|
marker->pattern_corners[3][0] = track->pat_min[0];
|
|
|
|
marker->pattern_corners[3][1] = track->pat_max[1];
|
|
|
|
}
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
if (is_zero_v2(marker->search_min) && is_zero_v2(marker->search_max)) {
|
|
|
|
copy_v2_v2(marker->search_min, track->search_min);
|
|
|
|
copy_v2_v2(marker->search_max, track->search_max);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *node_get_static_idname(int type, int treetype)
|
|
|
|
{
|
|
|
|
/* use static type info header to map static int type to identifier string */
|
2013-12-22 14:11:10 +11:00
|
|
|
#define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \
|
2013-11-29 23:16:13 +06:00
|
|
|
case ID: return #Category #StructName;
|
|
|
|
|
|
|
|
/* XXX hack, group types share a single static integer identifier, but are registered as separate types */
|
|
|
|
if (type == NODE_GROUP) {
|
|
|
|
switch (treetype) {
|
|
|
|
case NTREE_COMPOSIT: return "CompositorNodeGroup";
|
|
|
|
case NTREE_SHADER: return "ShaderNodeGroup";
|
|
|
|
case NTREE_TEXTURE: return "TextureNodeGroup";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
switch (type) {
|
2013-12-22 14:11:10 +11:00
|
|
|
#include "NOD_static_types.h"
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *node_socket_get_static_idname(bNodeSocket *sock)
|
|
|
|
{
|
|
|
|
switch (sock->type) {
|
|
|
|
case SOCK_FLOAT:
|
|
|
|
{
|
|
|
|
bNodeSocketValueFloat *dval = sock->default_value;
|
|
|
|
return nodeStaticSocketType(SOCK_FLOAT, dval->subtype);
|
|
|
|
}
|
|
|
|
case SOCK_INT:
|
|
|
|
{
|
|
|
|
bNodeSocketValueInt *dval = sock->default_value;
|
|
|
|
return nodeStaticSocketType(SOCK_INT, dval->subtype);
|
|
|
|
}
|
|
|
|
case SOCK_BOOLEAN:
|
|
|
|
{
|
|
|
|
return nodeStaticSocketType(SOCK_BOOLEAN, PROP_NONE);
|
|
|
|
}
|
|
|
|
case SOCK_VECTOR:
|
|
|
|
{
|
|
|
|
bNodeSocketValueVector *dval = sock->default_value;
|
|
|
|
return nodeStaticSocketType(SOCK_VECTOR, dval->subtype);
|
|
|
|
}
|
|
|
|
case SOCK_RGBA:
|
|
|
|
{
|
|
|
|
return nodeStaticSocketType(SOCK_RGBA, PROP_NONE);
|
|
|
|
}
|
|
|
|
case SOCK_STRING:
|
|
|
|
{
|
|
|
|
bNodeSocketValueString *dval = sock->default_value;
|
|
|
|
return nodeStaticSocketType(SOCK_STRING, dval->subtype);
|
|
|
|
}
|
|
|
|
case SOCK_SHADER:
|
|
|
|
{
|
|
|
|
return nodeStaticSocketType(SOCK_SHADER, PROP_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
static void do_versions_nodetree_customnodes(bNodeTree *ntree, int UNUSED(is_group))
|
|
|
|
{
|
|
|
|
/* initialize node tree type idname */
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
|
|
|
ntree->typeinfo = NULL;
|
|
|
|
|
|
|
|
/* tree type idname */
|
|
|
|
switch (ntree->type) {
|
|
|
|
case NTREE_COMPOSIT:
|
|
|
|
strcpy(ntree->idname, "CompositorNodeTree");
|
|
|
|
break;
|
|
|
|
case NTREE_SHADER:
|
|
|
|
strcpy(ntree->idname, "ShaderNodeTree");
|
|
|
|
break;
|
|
|
|
case NTREE_TEXTURE:
|
|
|
|
strcpy(ntree->idname, "TextureNodeTree");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* node type idname */
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
BLI_strncpy(node->idname, node_get_static_idname(node->type, ntree->type), sizeof(node->idname));
|
|
|
|
|
|
|
|
/* existing old nodes have been initialized already */
|
|
|
|
node->flag |= NODE_INIT;
|
|
|
|
|
|
|
|
/* sockets idname */
|
|
|
|
for (sock = node->inputs.first; sock; sock = sock->next)
|
|
|
|
BLI_strncpy(sock->idname, node_socket_get_static_idname(sock), sizeof(sock->idname));
|
|
|
|
for (sock = node->outputs.first; sock; sock = sock->next)
|
|
|
|
BLI_strncpy(sock->idname, node_socket_get_static_idname(sock), sizeof(sock->idname));
|
|
|
|
}
|
|
|
|
/* tree sockets idname */
|
|
|
|
for (sock = ntree->inputs.first; sock; sock = sock->next)
|
|
|
|
BLI_strncpy(sock->idname, node_socket_get_static_idname(sock), sizeof(sock->idname));
|
|
|
|
for (sock = ntree->outputs.first; sock; sock = sock->next)
|
|
|
|
BLI_strncpy(sock->idname, node_socket_get_static_idname(sock), sizeof(sock->idname));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize socket in_out values */
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
for (sock = node->inputs.first; sock; sock = sock->next)
|
|
|
|
sock->in_out = SOCK_IN;
|
|
|
|
for (sock = node->outputs.first; sock; sock = sock->next)
|
|
|
|
sock->in_out = SOCK_OUT;
|
|
|
|
}
|
|
|
|
for (sock = ntree->inputs.first; sock; sock = sock->next)
|
|
|
|
sock->in_out = SOCK_IN;
|
|
|
|
for (sock = ntree->outputs.first; sock; sock = sock->next)
|
|
|
|
sock->in_out = SOCK_OUT;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize socket identifier strings */
|
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
for (sock = node->inputs.first; sock; sock = sock->next) {
|
|
|
|
BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
|
|
|
|
BLI_uniquename(&node->inputs, sock, "socket", '.',
|
|
|
|
offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
|
|
|
|
}
|
|
|
|
for (sock = node->outputs.first; sock; sock = sock->next) {
|
|
|
|
BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
|
|
|
|
BLI_uniquename(&node->outputs, sock, "socket", '.',
|
|
|
|
offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (sock = ntree->inputs.first; sock; sock = sock->next) {
|
|
|
|
BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
|
|
|
|
BLI_uniquename(&ntree->inputs, sock, "socket", '.',
|
|
|
|
offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
|
|
|
|
}
|
|
|
|
for (sock = ntree->outputs.first; sock; sock = sock->next) {
|
|
|
|
BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
|
|
|
|
BLI_uniquename(&ntree->outputs, sock, "socket", '.',
|
|
|
|
offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 260) {
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
|
|
|
/* set default alpha value of Image outputs in image and render layer nodes to 0 */
|
|
|
|
Scene *sce;
|
|
|
|
bNodeTree *ntree;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* there are files with invalid audio_channels value, the real cause
|
|
|
|
* is unknown, but we fix it here anyway to avoid crashes */
|
|
|
|
if (sce->r.ffcodecdata.audio_channels == 0)
|
|
|
|
sce->r.ffcodecdata.audio_channels = 2;
|
|
|
|
|
|
|
|
if (sce->nodetree)
|
|
|
|
do_versions_nodetree_image_default_alpha_output(sce->nodetree);
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
do_versions_nodetree_image_default_alpha_output(ntree);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
/* support old particle dupliobject rotation settings */
|
|
|
|
ParticleSettings *part;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (part = bmain->particles.first; part; part = part->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
|
|
|
|
part->draw |= PART_DRAW_ROTATE_OB;
|
|
|
|
|
|
|
|
if (part->rotmode == 0)
|
|
|
|
part->rotmode = PART_ROT_VEL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 1)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Object *ob;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ob->collision_boundtype = ob->boundtype;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
Camera *cam;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (cam = bmain->cameras.first; cam; cam = cam->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (cam->sensor_x < 0.01f)
|
|
|
|
cam->sensor_x = DEFAULT_SENSOR_WIDTH;
|
|
|
|
|
|
|
|
if (cam->sensor_y < 0.01f)
|
|
|
|
cam->sensor_y = DEFAULT_SENSOR_HEIGHT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 2)) {
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ntree->type == NTREE_SHADER) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == SH_NODE_MAPPING) {
|
|
|
|
TexMapping *tex_mapping;
|
|
|
|
|
|
|
|
tex_mapping = node->storage;
|
|
|
|
tex_mapping->projx = PROJ_X;
|
|
|
|
tex_mapping->projy = PROJ_Y;
|
|
|
|
tex_mapping->projz = PROJ_Z;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 4)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
|
|
|
/* Convert node angles to radians! */
|
|
|
|
Scene *sce;
|
|
|
|
Material *mat;
|
|
|
|
bNodeTree *ntree;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (sce->nodetree)
|
|
|
|
do_versions_nodetree_convert_angle(sce->nodetree);
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (mat = bmain->materials.first; mat; mat = mat->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (mat->nodetree)
|
|
|
|
do_versions_nodetree_convert_angle(mat->nodetree);
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
do_versions_nodetree_convert_angle(ntree);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
/* Tomato compatibility code. */
|
|
|
|
bScreen *sc;
|
|
|
|
MovieClip *clip;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ScrArea *sa;
|
|
|
|
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
|
|
|
SpaceLink *sl;
|
|
|
|
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
|
|
|
if (sl->spacetype == SPACE_VIEW3D) {
|
|
|
|
View3D *v3d = (View3D *)sl;
|
|
|
|
if (v3d->bundle_size == 0.0f) {
|
|
|
|
v3d->bundle_size = 0.2f;
|
|
|
|
v3d->flag2 |= V3D_SHOW_RECONSTRUCTION;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (v3d->bundle_drawtype == 0)
|
|
|
|
v3d->bundle_drawtype = OB_PLAINAXES;
|
|
|
|
}
|
|
|
|
else if (sl->spacetype == SPACE_CLIP) {
|
|
|
|
SpaceClip *sclip = (SpaceClip *)sl;
|
|
|
|
if (sclip->scopes.track_preview_height == 0)
|
|
|
|
sclip->scopes.track_preview_height = 120;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (clip = bmain->movieclips.first; clip; clip = clip->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
MovieTrackingTrack *track;
|
|
|
|
|
|
|
|
if (clip->aspx < 1.0f) {
|
|
|
|
clip->aspx = 1.0f;
|
|
|
|
clip->aspy = 1.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
clip->proxy.build_tc_flag = IMB_TC_RECORD_RUN |
|
|
|
|
IMB_TC_FREE_RUN |
|
|
|
|
IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN;
|
|
|
|
|
|
|
|
if (clip->proxy.build_size_flag == 0)
|
|
|
|
clip->proxy.build_size_flag = IMB_PROXY_25;
|
|
|
|
|
|
|
|
if (clip->proxy.quality == 0)
|
|
|
|
clip->proxy.quality = 90;
|
|
|
|
|
|
|
|
if (clip->tracking.camera.pixel_aspect < 0.01f)
|
|
|
|
clip->tracking.camera.pixel_aspect = 1.0f;
|
|
|
|
|
|
|
|
track = clip->tracking.tracks.first;
|
|
|
|
while (track) {
|
|
|
|
if (track->minimum_correlation == 0.0f)
|
|
|
|
track->minimum_correlation = 0.75f;
|
|
|
|
|
|
|
|
track = track->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 6)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Scene *sce;
|
|
|
|
MovieClip *clip;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
do_versions_image_settings_2_60(sce);
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (clip = bmain->movieclips.first; clip; clip = clip->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
MovieTrackingSettings *settings = &clip->tracking.settings;
|
|
|
|
|
|
|
|
if (settings->default_pattern_size == 0.0f) {
|
|
|
|
settings->default_motion_model = TRACK_MOTION_MODEL_TRANSLATION;
|
|
|
|
settings->default_minimum_correlation = 0.75;
|
|
|
|
settings->default_pattern_size = 11;
|
|
|
|
settings->default_search_size = 51;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
Object *ob;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* convert delta addition into delta scale */
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
if ( (ob->dsize[i] == 0.0f) || /* simple case, user never touched dsize */
|
2019-02-18 15:43:06 +11:00
|
|
|
(ob->scale[i] == 0.0f)) /* cant scale the dsize to give a non zero result,
|
2014-06-09 11:01:51 +10:00
|
|
|
* so fallback to 1.0f */
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
|
|
|
ob->dscale[i] = 1.0f;
|
|
|
|
}
|
|
|
|
else {
|
2019-02-18 15:43:06 +11:00
|
|
|
ob->dscale[i] = (ob->scale[i] + ob->dsize[i]) / ob->scale[i];
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* sigh, this dscale vs dsize version patching was not done right, fix for fix,
|
|
|
|
* this intentionally checks an exact subversion, also note this was never in a release,
|
|
|
|
* at some point this could be removed. */
|
2018-06-05 15:10:33 +02:00
|
|
|
else if (bmain->versionfile == 260 && bmain->subversionfile == 6) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Object *ob;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (is_zero_v3(ob->dscale)) {
|
2015-05-05 17:08:29 +10:00
|
|
|
copy_vn_fl(ob->dscale, 3, 1.0f);
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 8)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Brush *brush;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (brush->sculpt_tool == SCULPT_TOOL_ROTATE)
|
|
|
|
brush->alpha = 1.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 261 || (bmain->versionfile == 261 && bmain->subversionfile < 1)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
|
|
|
/* update use flags for node sockets (was only temporary before) */
|
|
|
|
Scene *sce;
|
|
|
|
Material *mat;
|
|
|
|
Tex *tex;
|
|
|
|
World *world;
|
|
|
|
bNodeTree *ntree;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (sce->nodetree)
|
|
|
|
do_versions_nodetree_socket_use_flags_2_62(sce->nodetree);
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (mat = bmain->materials.first; mat; mat = mat->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (mat->nodetree)
|
|
|
|
do_versions_nodetree_socket_use_flags_2_62(mat->nodetree);
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (tex = bmain->textures.first; tex; tex = tex->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (tex->nodetree)
|
|
|
|
do_versions_nodetree_socket_use_flags_2_62(tex->nodetree);
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (Light *la = bmain->lights.first; la; la = la->id.next) {
|
2019-02-27 10:46:48 +11:00
|
|
|
if (la->nodetree)
|
|
|
|
do_versions_nodetree_socket_use_flags_2_62(la->nodetree);
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (world = bmain->worlds.first; world; world = world->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (world->nodetree)
|
|
|
|
do_versions_nodetree_socket_use_flags_2_62(world->nodetree);
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
do_versions_nodetree_socket_use_flags_2_62(ntree);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
MovieClip *clip;
|
|
|
|
Object *ob;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (clip = bmain->movieclips.first; clip; clip = clip->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
MovieTrackingObject *tracking_object = tracking->objects.first;
|
|
|
|
|
|
|
|
clip->proxy.build_tc_flag |= IMB_TC_RECORD_RUN_NO_GAPS;
|
|
|
|
|
|
|
|
if (!tracking->settings.object_distance)
|
|
|
|
tracking->settings.object_distance = 1.0f;
|
|
|
|
|
2014-02-08 06:07:10 +11:00
|
|
|
if (BLI_listbase_is_empty(&tracking->objects))
|
2013-11-29 23:16:13 +06:00
|
|
|
BKE_tracking_object_add(tracking, "Camera");
|
|
|
|
|
|
|
|
while (tracking_object) {
|
|
|
|
if (!tracking_object->scale)
|
|
|
|
tracking_object->scale = 1.0f;
|
|
|
|
|
|
|
|
tracking_object = tracking_object->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
bConstraint *con;
|
|
|
|
for (con = ob->constraints.first; con; con = con->next) {
|
|
|
|
if (con->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
|
|
|
|
bObjectSolverConstraint *data = (bObjectSolverConstraint *)con->data;
|
|
|
|
|
|
|
|
if (data->invmat[3][3] == 0.0f)
|
|
|
|
unit_m4(data->invmat);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 261 || (bmain->versionfile == 261 && bmain->subversionfile < 2)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
|
|
|
/* convert deprecated sculpt_paint_unified_* fields to
|
|
|
|
* UnifiedPaintSettings */
|
|
|
|
Scene *scene;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ToolSettings *ts = scene->toolsettings;
|
|
|
|
UnifiedPaintSettings *ups = &ts->unified_paint_settings;
|
|
|
|
ups->size = ts->sculpt_paint_unified_size;
|
|
|
|
ups->unprojected_radius = ts->sculpt_paint_unified_unprojected_radius;
|
|
|
|
ups->alpha = ts->sculpt_paint_unified_alpha;
|
|
|
|
ups->flag = ts->sculpt_paint_settings;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 261 || (bmain->versionfile == 261 && bmain->subversionfile < 3)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
|
|
|
/* convert extended ascii to utf-8 for text editor */
|
|
|
|
Text *text;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (text = bmain->texts.first; text; text = text->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (!(text->flags & TXT_ISEXT)) {
|
|
|
|
TextLine *tl;
|
|
|
|
|
|
|
|
for (tl = text->lines.first; tl; tl = tl->next) {
|
|
|
|
int added = txt_extended_ascii_as_utf8(&tl->line);
|
|
|
|
tl->len += added;
|
|
|
|
|
|
|
|
/* reset cursor position if line was changed */
|
|
|
|
if (added && tl == text->curl)
|
|
|
|
text->curc = 0;
|
|
|
|
}
|
|
|
|
}
|
2017-05-19 22:18:54 +10:00
|
|
|
}
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
{
|
|
|
|
/* set new dynamic paint values */
|
|
|
|
Object *ob;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ModifierData *md;
|
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_DynamicPaint) {
|
|
|
|
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
|
|
|
|
if (pmd->canvas) {
|
|
|
|
DynamicPaintSurface *surface = pmd->canvas->surfaces.first;
|
|
|
|
for (; surface; surface = surface->next) {
|
|
|
|
surface->color_dry_threshold = 1.0f;
|
|
|
|
surface->influence_scale = 1.0f;
|
|
|
|
surface->radius_scale = 1.0f;
|
|
|
|
surface->flags |= MOD_DPAINT_USE_DRYING;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 262) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Object *ob;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ModifierData *md;
|
|
|
|
|
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_Cloth) {
|
2018-11-30 14:51:16 +11:00
|
|
|
ClothModifierData *clmd = (ClothModifierData *)md;
|
2013-11-29 23:16:13 +06:00
|
|
|
if (clmd->sim_parms)
|
|
|
|
clmd->sim_parms->vel_damping = 1.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* set fluidsim rate. the version patch for this in 2.62 was wrong, so
|
|
|
|
* try to correct it, if rate is 0.0 that's likely not intentional */
|
|
|
|
Object *ob;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ModifierData *md;
|
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_Fluidsim) {
|
|
|
|
FluidsimModifierData *fmd = (FluidsimModifierData *)md;
|
|
|
|
if (fmd->fss->animRate == 0.0f)
|
|
|
|
fmd->fss->animRate = 1.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 1)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* update use flags for node sockets (was only temporary before) */
|
|
|
|
Scene *sce;
|
|
|
|
bNodeTree *ntree;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (sce->nodetree)
|
|
|
|
do_versions_nodetree_multi_file_output_format_2_62_1(sce, sce->nodetree);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* XXX can't associate with scene for group nodes, image format will stay uninitialized */
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
do_versions_nodetree_multi_file_output_format_2_62_1(NULL, ntree);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* only swap for pre-release bmesh merge which had MLoopCol red/blue swap */
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile == 262 && bmain->subversionfile == 1) {
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
|
|
|
Mesh *me;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (me = bmain->meshes.first; me; me = me->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
do_versions_mesh_mloopcol_swap_2_62_1(me);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 2)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* Set new idname of keyingsets from their now "label-only" name. */
|
|
|
|
Scene *scene;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
KeyingSet *ks;
|
|
|
|
for (ks = scene->keyingsets.first; ks; ks = ks->next) {
|
|
|
|
if (!ks->idname[0])
|
|
|
|
BLI_strncpy(ks->idname, ks->name, sizeof(ks->idname));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 3)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Object *ob;
|
|
|
|
ModifierData *md;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_Lattice) {
|
|
|
|
LatticeModifierData *lmd = (LatticeModifierData *)md;
|
|
|
|
lmd->strength = 1.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 4)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* Read Viscosity presets from older files */
|
|
|
|
Object *ob;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ModifierData *md;
|
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_Fluidsim) {
|
|
|
|
FluidsimModifierData *fmd = (FluidsimModifierData *)md;
|
|
|
|
if (fmd->fss->viscosityMode == 3) {
|
|
|
|
fmd->fss->viscosityValue = 5.0;
|
|
|
|
fmd->fss->viscosityExponent = 5;
|
|
|
|
}
|
|
|
|
else if (fmd->fss->viscosityMode == 4) {
|
|
|
|
fmd->fss->viscosityValue = 2.0;
|
|
|
|
fmd->fss->viscosityExponent = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* Default for old files is to save particle rotations to pointcache */
|
|
|
|
ParticleSettings *part;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (part = bmain->particles.first; part; part = part->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
part->flag |= PART_ROTATIONS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 1)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* file output node paths are now stored in the file info struct instead socket name */
|
|
|
|
Scene *sce;
|
|
|
|
bNodeTree *ntree;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sce = bmain->scenes.first; sce; sce = sce->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
if (sce->nodetree)
|
|
|
|
do_versions_nodetree_multi_file_output_path_2_63_1(sce->nodetree);
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
do_versions_nodetree_multi_file_output_path_2_63_1(ntree);
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 3)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Scene *scene;
|
|
|
|
Brush *brush;
|
|
|
|
|
|
|
|
/* For weight paint, each brush now gets its own weight;
|
|
|
|
* unified paint settings also have weight. Update unified
|
|
|
|
* paint settings and brushes with a default weight value. */
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ToolSettings *ts = scene->toolsettings;
|
|
|
|
if (ts) {
|
|
|
|
ts->unified_paint_settings.weight = ts->vgroup_weight;
|
|
|
|
ts->unified_paint_settings.flag |= UNIFIED_PAINT_WEIGHT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
brush->weight = 0.5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 2)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
bScreen *sc;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ScrArea *sa;
|
|
|
|
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
|
|
|
SpaceLink *sl;
|
|
|
|
|
|
|
|
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
|
|
|
if (sl->spacetype == SPACE_CLIP) {
|
|
|
|
SpaceClip *sclip = (SpaceClip *)sl;
|
|
|
|
ARegion *ar;
|
2014-04-01 11:34:00 +11:00
|
|
|
bool hide = false;
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
for (ar = sa->regionbase.first; ar; ar = ar->next) {
|
|
|
|
if (ar->regiontype == RGN_TYPE_PREVIEW) {
|
|
|
|
if (ar->alignment != RGN_ALIGN_NONE) {
|
|
|
|
ar->flag |= RGN_FLAG_HIDDEN;
|
|
|
|
ar->v2d.flag &= ~V2D_IS_INITIALISED;
|
|
|
|
ar->alignment = RGN_ALIGN_NONE;
|
|
|
|
|
2014-04-01 11:34:00 +11:00
|
|
|
hide = true;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hide) {
|
|
|
|
sclip->view = SC_VIEW_CLIP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 4)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Camera *cam;
|
|
|
|
Curve *cu;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (cam = bmain->cameras.first; cam; cam = cam->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (cam->flag & CAM_PANORAMA) {
|
|
|
|
cam->type = CAM_PANO;
|
|
|
|
cam->flag &= ~CAM_PANORAMA;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (cu = bmain->curves.first; cu; cu = cu->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (cu->bevfac2 == 0.0f) {
|
|
|
|
cu->bevfac1 = 0.0f;
|
|
|
|
cu->bevfac2 = 1.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 5)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
|
|
|
/* file output node paths are now stored in the file info struct instead socket name */
|
|
|
|
Scene *sce;
|
|
|
|
bNodeTree *ntree;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (sce->nodetree) {
|
|
|
|
do_versions_nodetree_file_output_layers_2_64_5(sce->nodetree);
|
|
|
|
do_versions_nodetree_image_layer_2_64_5(sce->nodetree);
|
|
|
|
}
|
|
|
|
}
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
do_versions_nodetree_file_output_layers_2_64_5(ntree);
|
|
|
|
do_versions_nodetree_image_layer_2_64_5(ntree);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 6)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* update use flags for node sockets (was only temporary before) */
|
|
|
|
Scene *sce;
|
|
|
|
Material *mat;
|
|
|
|
Tex *tex;
|
|
|
|
World *world;
|
|
|
|
bNodeTree *ntree;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sce = bmain->scenes.first; sce; sce = sce->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
if (sce->nodetree)
|
|
|
|
do_versions_nodetree_frame_2_64_6(sce->nodetree);
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (mat = bmain->materials.first; mat; mat = mat->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
if (mat->nodetree)
|
|
|
|
do_versions_nodetree_frame_2_64_6(mat->nodetree);
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (tex = bmain->textures.first; tex; tex = tex->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
if (tex->nodetree)
|
|
|
|
do_versions_nodetree_frame_2_64_6(tex->nodetree);
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (Light *la = bmain->lights.first; la; la = la->id.next)
|
2019-02-27 10:46:48 +11:00
|
|
|
if (la->nodetree)
|
|
|
|
do_versions_nodetree_frame_2_64_6(la->nodetree);
|
2013-11-29 23:16:13 +06:00
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (world = bmain->worlds.first; world; world = world->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
if (world->nodetree)
|
|
|
|
do_versions_nodetree_frame_2_64_6(world->nodetree);
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
do_versions_nodetree_frame_2_64_6(ntree);
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 7)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Object *ob;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ModifierData *md;
|
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_Smoke) {
|
|
|
|
SmokeModifierData *smd = (SmokeModifierData *)md;
|
|
|
|
if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
|
|
|
|
int maxres = max_iii(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2]);
|
|
|
|
smd->domain->scale = smd->domain->dx * maxres;
|
|
|
|
smd->domain->dx = 1.0f / smd->domain->scale;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 9)) {
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ntree->type == NTREE_SHADER) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (ELEM(node->type, SH_NODE_TEX_IMAGE, SH_NODE_TEX_ENVIRONMENT)) {
|
|
|
|
NodeTexImage *tex = node->storage;
|
|
|
|
|
|
|
|
tex->iuser.frames = 1;
|
|
|
|
tex->iuser.sfra = 1;
|
|
|
|
tex->iuser.ok = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 10)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
|
|
|
Scene *scene;
|
|
|
|
// composite redesign
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (scene->nodetree) {
|
|
|
|
if (scene->nodetree->chunksize == 0) {
|
|
|
|
scene->nodetree->chunksize = 256;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ntree->type == NTREE_COMPOSIT) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_DEFOCUS) {
|
|
|
|
NodeDefocus *data = node->storage;
|
|
|
|
if (data->maxblur == 0.0f) {
|
|
|
|
data->maxblur = 16.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
bScreen *sc;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ScrArea *sa;
|
|
|
|
|
|
|
|
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
|
|
|
SpaceLink *sl;
|
|
|
|
|
|
|
|
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
|
|
|
if (sl->spacetype == SPACE_CLIP) {
|
|
|
|
SpaceClip *sclip = (SpaceClip *)sl;
|
|
|
|
|
|
|
|
if (sclip->around == 0) {
|
2018-12-14 11:01:01 +11:00
|
|
|
sclip->around = V3D_AROUND_CENTER_MEDIAN;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
MovieClip *clip;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (clip = bmain->movieclips.first; clip; clip = clip->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
clip->start_frame = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 11)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
MovieClip *clip;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (clip = bmain->movieclips.first; clip; clip = clip->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
MovieTrackingTrack *track;
|
|
|
|
|
|
|
|
track = clip->tracking.tracks.first;
|
|
|
|
while (track) {
|
|
|
|
do_versions_affine_tracker_track(track);
|
|
|
|
|
|
|
|
track = track->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 13)) {
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ntree->type == NTREE_COMPOSIT) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_DILATEERODE) {
|
|
|
|
if (node->storage == NULL) {
|
|
|
|
NodeDilateErode *data = MEM_callocN(sizeof(NodeDilateErode), __func__);
|
|
|
|
data->falloff = PROP_SMOOTH;
|
|
|
|
node->storage = data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 14)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ParticleSettings *part;
|
|
|
|
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ntree->type == NTREE_COMPOSIT) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_KEYING) {
|
|
|
|
NodeKeyingData *data = node->storage;
|
|
|
|
|
|
|
|
if (data->despill_balance == 0.0f) {
|
|
|
|
data->despill_balance = 0.5f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
/* keep compatibility for dupliobject particle size */
|
2019-03-08 09:29:17 +11:00
|
|
|
for (part = bmain->particles.first; part; part = part->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR))
|
|
|
|
if ((part->draw & PART_DRAW_ROTATE_OB) == 0)
|
|
|
|
part->draw |= PART_DRAW_NO_SCALE_OB;
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 17)) {
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ntree->type == NTREE_COMPOSIT) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_MASK) {
|
|
|
|
if (node->storage == NULL) {
|
|
|
|
NodeMask *data = MEM_callocN(sizeof(NodeMask), __func__);
|
|
|
|
/* move settings into own struct */
|
|
|
|
data->size_x = (int)node->custom3;
|
|
|
|
data->size_y = (int)node->custom4;
|
|
|
|
node->custom3 = 0.5f; /* default shutter */
|
|
|
|
node->storage = data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 18)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Scene *scene;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (scene->ed) {
|
|
|
|
Sequence *seq;
|
|
|
|
|
|
|
|
SEQ_BEGIN (scene->ed, seq)
|
|
|
|
{
|
|
|
|
Strip *strip = seq->strip;
|
|
|
|
|
|
|
|
if (strip && strip->color_balance) {
|
|
|
|
SequenceModifierData *smd;
|
|
|
|
ColorBalanceModifierData *cbmd;
|
|
|
|
|
2016-02-16 00:05:44 +11:00
|
|
|
smd = BKE_sequence_modifier_new(seq, NULL, seqModifierType_ColorBalance);
|
2018-11-30 14:51:16 +11:00
|
|
|
cbmd = (ColorBalanceModifierData *)smd;
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
cbmd->color_balance = *strip->color_balance;
|
|
|
|
|
|
|
|
/* multiplication with color balance used is handled differently,
|
|
|
|
* so we need to move multiplication to modifier so files would be
|
|
|
|
* compatible
|
|
|
|
*/
|
|
|
|
cbmd->color_multiply = seq->mul;
|
|
|
|
seq->mul = 1.0f;
|
|
|
|
|
|
|
|
MEM_freeN(strip->color_balance);
|
|
|
|
strip->color_balance = NULL;
|
|
|
|
}
|
2018-11-30 15:35:15 +11:00
|
|
|
} SEQ_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* color management pipeline changes compatibility code */
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 19)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Scene *scene;
|
|
|
|
Image *ima;
|
2014-04-01 11:34:00 +11:00
|
|
|
bool colormanagement_disabled = false;
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
/* make scenes which are not using color management have got None as display device,
|
|
|
|
* so they wouldn't perform linear-to-sRGB conversion on display
|
|
|
|
*/
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if ((scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) == 0) {
|
|
|
|
ColorManagedDisplaySettings *display_settings = &scene->display_settings;
|
|
|
|
|
|
|
|
if (display_settings->display_device[0] == 0) {
|
|
|
|
BKE_scene_disable_color_management(scene);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-04-01 11:34:00 +11:00
|
|
|
colormanagement_disabled = true;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ima = bmain->images.first; ima; ima = ima->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ima->source == IMA_SRC_VIEWER) {
|
|
|
|
ima->flag |= IMA_VIEW_AS_RENDER;
|
|
|
|
}
|
|
|
|
else if (colormanagement_disabled) {
|
|
|
|
/* if colormanagement not used, set image's color space to raw, so no sRGB->linear conversion
|
|
|
|
* would happen on display and render
|
|
|
|
* there's no clear way to check whether color management is enabled or not in render engine
|
|
|
|
* so set all images to raw if there's at least one scene with color management disabled
|
|
|
|
* this would still behave incorrect in cases when color management was used for only some
|
|
|
|
* of scenes, but such a setup is crazy anyway and think it's fair enough to break compatibility
|
|
|
|
* in that cases
|
|
|
|
*/
|
|
|
|
|
|
|
|
BLI_strncpy(ima->colorspace_settings.name, "Raw", sizeof(ima->colorspace_settings.name));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 20)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Key *key;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (key = bmain->shapekeys.first; key; key = key->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
blo_do_versions_key_uidgen(key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 21)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
|
|
|
Mesh *me;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (me = bmain->meshes.first; me; me = me->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
CustomData_update_typemap(&me->vdata);
|
|
|
|
CustomData_free_layers(&me->vdata, CD_MSTICKY, me->totvert);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* correction for files saved in blender version when BKE_pose_copy_data
|
|
|
|
* didn't copy animation visualization, which lead to deadlocks on motion
|
|
|
|
* path calculation for proxied armatures, see [#32742]
|
|
|
|
*/
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 264) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Object *ob;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ob->pose) {
|
|
|
|
if (ob->pose->avs.path_step == 0) {
|
|
|
|
animviz_settings_init(&ob->pose->avs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 1)) {
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ntree->type == NTREE_SHADER) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next)
|
|
|
|
if (node->type == SH_NODE_TEX_COORD)
|
|
|
|
node->flag |= NODE_OPTIONS;
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 2)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
MovieClip *clip;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (clip = bmain->movieclips.first; clip; clip = clip->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
MovieTrackingObject *tracking_object;
|
|
|
|
|
|
|
|
for (tracking_object = tracking->objects.first;
|
|
|
|
tracking_object;
|
|
|
|
tracking_object = tracking_object->next)
|
|
|
|
{
|
|
|
|
if (tracking_object->keyframe1 == 0 && tracking_object->keyframe2 == 0) {
|
|
|
|
tracking_object->keyframe1 = tracking->settings.keyframe1;
|
|
|
|
tracking_object->keyframe2 = tracking->settings.keyframe2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 3)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* smoke branch */
|
|
|
|
{
|
|
|
|
Object *ob;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ModifierData *md;
|
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_Smoke) {
|
|
|
|
SmokeModifierData *smd = (SmokeModifierData *)md;
|
|
|
|
if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
|
|
|
|
/* keep branch saves if possible */
|
|
|
|
if (!smd->domain->flame_max_temp) {
|
|
|
|
smd->domain->burning_rate = 0.75f;
|
|
|
|
smd->domain->flame_smoke = 1.0f;
|
|
|
|
smd->domain->flame_vorticity = 0.5f;
|
|
|
|
smd->domain->flame_ignition = 1.25f;
|
|
|
|
smd->domain->flame_max_temp = 1.75f;
|
|
|
|
smd->domain->adapt_threshold = 0.02f;
|
|
|
|
smd->domain->adapt_margin = 4;
|
|
|
|
smd->domain->flame_smoke_color[0] = 0.7f;
|
|
|
|
smd->domain->flame_smoke_color[1] = 0.7f;
|
|
|
|
smd->domain->flame_smoke_color[2] = 0.7f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ((smd->type & MOD_SMOKE_TYPE_FLOW) && smd->flow) {
|
|
|
|
if (!smd->flow->texture_size) {
|
|
|
|
smd->flow->fuel_amount = 1.0;
|
|
|
|
smd->flow->surface_distance = 1.5;
|
|
|
|
smd->flow->color[0] = 0.7f;
|
|
|
|
smd->flow->color[1] = 0.7f;
|
|
|
|
smd->flow->color[2] = 0.7f;
|
|
|
|
smd->flow->texture_size = 1.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* render border for viewport */
|
|
|
|
{
|
|
|
|
bScreen *sc;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ScrArea *sa;
|
|
|
|
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
|
|
|
SpaceLink *sl;
|
|
|
|
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
|
|
|
if (sl->spacetype == SPACE_VIEW3D) {
|
|
|
|
View3D *v3d = (View3D *)sl;
|
|
|
|
if (v3d->render_border.xmin == 0.0f && v3d->render_border.ymin == 0.0f &&
|
|
|
|
v3d->render_border.xmax == 0.0f && v3d->render_border.ymax == 0.0f)
|
|
|
|
{
|
|
|
|
v3d->render_border.xmax = 1.0f;
|
|
|
|
v3d->render_border.ymax = 1.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 5)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* set a unwrapping margin and ABF by default */
|
|
|
|
Scene *scene;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (scene->toolsettings->uvcalc_margin == 0.0f) {
|
|
|
|
scene->toolsettings->uvcalc_margin = 0.001f;
|
|
|
|
scene->toolsettings->unwrapper = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 6)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* Fix for bug #32982, internal_links list could get corrupted from r51630 onward.
|
|
|
|
* Simply remove bad internal_links lists to avoid NULL pointers.
|
|
|
|
*/
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
bNode *node;
|
|
|
|
bNodeLink *link, *nextlink;
|
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
for (link = node->internal_links.first; link; link = nextlink) {
|
|
|
|
nextlink = link->next;
|
|
|
|
if (!link->fromnode || !link->fromsock || !link->tonode || !link->tosock) {
|
|
|
|
BLI_remlink(&node->internal_links, link);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 7)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* convert tiles size from resolution and number of tiles */
|
|
|
|
{
|
|
|
|
Scene *scene;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (scene->r.tilex == 0 || scene->r.tiley == 1) {
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
scene->r.tilex = scene->r.tiley = 64;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* collision masks */
|
|
|
|
{
|
|
|
|
Object *ob;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ob->col_group == 0) {
|
|
|
|
ob->col_group = 0x01;
|
|
|
|
ob->col_mask = 0xff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 7)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
MovieClip *clip;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (clip = bmain->movieclips.first; clip; clip = clip->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
MovieTrackingTrack *track;
|
|
|
|
MovieTrackingObject *object;
|
|
|
|
|
|
|
|
for (track = clip->tracking.tracks.first; track; track = track->next) {
|
|
|
|
do_versions_affine_tracker_track(track);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (object = clip->tracking.objects.first; object; object = object->next) {
|
|
|
|
for (track = object->tracks.first; track; track = track->next) {
|
|
|
|
do_versions_affine_tracker_track(track);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 3)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
bScreen *sc;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ScrArea *sa;
|
|
|
|
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
|
|
|
SpaceLink *sl;
|
|
|
|
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
|
|
|
switch (sl->spacetype) {
|
|
|
|
case SPACE_VIEW3D:
|
|
|
|
{
|
|
|
|
View3D *v3d = (View3D *)sl;
|
2018-07-31 10:22:19 +02:00
|
|
|
v3d->flag2 |= V3D_SHOW_ANNOTATION;
|
2013-11-29 23:16:13 +06:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SPACE_SEQ:
|
|
|
|
{
|
|
|
|
SpaceSeq *sseq = (SpaceSeq *)sl;
|
|
|
|
sseq->flag |= SEQ_SHOW_GPENCIL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SPACE_IMAGE:
|
|
|
|
{
|
|
|
|
SpaceImage *sima = (SpaceImage *)sl;
|
|
|
|
sima->flag |= SI_SHOW_GPENCIL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SPACE_NODE:
|
|
|
|
{
|
|
|
|
SpaceNode *snode = (SpaceNode *)sl;
|
|
|
|
snode->flag |= SNODE_SHOW_GPENCIL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SPACE_CLIP:
|
|
|
|
{
|
|
|
|
SpaceClip *sclip = (SpaceClip *)sl;
|
2018-07-31 10:22:19 +02:00
|
|
|
sclip->flag |= SC_SHOW_ANNOTATION;
|
2013-11-29 23:16:13 +06:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 5)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Scene *scene;
|
|
|
|
Tex *tex;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Sequence *seq;
|
|
|
|
|
|
|
|
SEQ_BEGIN (scene->ed, seq)
|
|
|
|
{
|
2018-12-17 13:21:49 +11:00
|
|
|
enum { SEQ_MAKE_PREMUL = (1 << 6) };
|
2013-11-29 23:16:13 +06:00
|
|
|
if (seq->flag & SEQ_MAKE_PREMUL) {
|
|
|
|
seq->alpha_mode = SEQ_ALPHA_STRAIGHT;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
BKE_sequence_alpha_mode_from_extension(seq);
|
|
|
|
}
|
2018-11-30 15:35:15 +11:00
|
|
|
} SEQ_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
if (scene->r.bake_samples == 0)
|
2015-01-24 03:10:23 +11:00
|
|
|
scene->r.bake_samples = 256;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (Image *image = bmain->images.first; image; image = image->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (image->flag & IMA_DO_PREMUL) {
|
|
|
|
image->alpha_mode = IMA_ALPHA_STRAIGHT;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
BKE_image_alpha_mode_from_extension(image);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (tex = bmain->textures.first; tex; tex = tex->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (tex->type == TEX_IMAGE && (tex->imaflag & TEX_USEALPHA) == 0) {
|
2015-11-23 15:45:10 +11:00
|
|
|
Image *image = blo_do_versions_newlibadr(fd, tex->id.lib, tex->ima);
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
if (image && (image->flag & IMA_DO_PREMUL) == 0)
|
|
|
|
image->flag |= IMA_IGNORE_ALPHA;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ntree->type == NTREE_COMPOSIT) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_IMAGE) {
|
|
|
|
Image *image = blo_do_versions_newlibadr(fd, ntree->id.lib, node->id);
|
|
|
|
|
|
|
|
if (image) {
|
|
|
|
if ((image->flag & IMA_DO_PREMUL) == 0 && image->alpha_mode == IMA_ALPHA_STRAIGHT)
|
|
|
|
node->custom1 |= CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
2018-06-05 15:10:33 +02:00
|
|
|
else if (bmain->versionfile < 266 || (bmain->versionfile == 266 && bmain->subversionfile < 1)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* texture use alpha was removed for 2.66 but added back again for 2.66a,
|
|
|
|
* for compatibility all textures assumed it to be enabled */
|
|
|
|
Tex *tex;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (tex = bmain->textures.first; tex; tex = tex->id.next)
|
2013-11-29 23:16:13 +06:00
|
|
|
if (tex->type == TEX_IMAGE)
|
|
|
|
tex->imaflag |= TEX_USEALPHA;
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 7)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Curve *cu;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (cu = bmain->curves.first; cu; cu = cu->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (cu->flag & (CU_FRONT | CU_BACK)) {
|
2018-11-30 14:51:16 +11:00
|
|
|
if (cu->ext1 != 0.0f || cu->ext2 != 0.0f) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Nurb *nu;
|
|
|
|
|
|
|
|
for (nu = cu->nurb.first; nu; nu = nu->next) {
|
|
|
|
int a;
|
|
|
|
|
|
|
|
if (nu->bezt) {
|
|
|
|
BezTriple *bezt = nu->bezt;
|
|
|
|
a = nu->pntsu;
|
|
|
|
|
|
|
|
while (a--) {
|
|
|
|
bezt->radius = 1.0f;
|
|
|
|
bezt++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (nu->bp) {
|
|
|
|
BPoint *bp = nu->bp;
|
|
|
|
a = nu->pntsu * nu->pntsv;
|
|
|
|
|
|
|
|
while (a--) {
|
|
|
|
bp->radius = 1.0f;
|
|
|
|
bp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (MAIN_VERSION_OLDER(bmain, 265, 9)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Mesh *me;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (me = bmain->meshes.first; me; me = me->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
BKE_mesh_do_versions_cd_flag_init(me);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (MAIN_VERSION_OLDER(bmain, 265, 10)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Brush *br;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (br = bmain->brushes.first; br; br = br->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (br->ob_mode & OB_MODE_TEXTURE_PAINT) {
|
|
|
|
br->mtex.brush_map_mode = MTEX_MAP_MODE_TILED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// add storage for compositor translate nodes when not existing
|
2018-06-05 15:10:33 +02:00
|
|
|
if (MAIN_VERSION_OLDER(bmain, 265, 11)) {
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ntree->type == NTREE_COMPOSIT) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_TRANSLATE && node->storage == NULL) {
|
|
|
|
node->storage = MEM_callocN(sizeof(NodeTranslateData), "node translate data");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (MAIN_VERSION_OLDER(bmain, 266, 2)) {
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
do_versions_nodetree_customnodes(ntree, ((ID *)ntree == id));
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (MAIN_VERSION_OLDER(bmain, 266, 2)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
bScreen *sc;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ScrArea *sa;
|
|
|
|
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
|
|
|
SpaceLink *sl;
|
|
|
|
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
|
|
|
if (sl->spacetype == SPACE_NODE) {
|
|
|
|
SpaceNode *snode = (SpaceNode *)sl;
|
|
|
|
|
|
|
|
/* reset pointers to force tree path update from context */
|
|
|
|
snode->nodetree = NULL;
|
|
|
|
snode->edittree = NULL;
|
|
|
|
snode->id = NULL;
|
|
|
|
snode->from = NULL;
|
|
|
|
|
|
|
|
/* convert deprecated treetype setting to tree_idname */
|
|
|
|
switch (snode->treetype) {
|
|
|
|
case NTREE_COMPOSIT:
|
|
|
|
strcpy(snode->tree_idname, "CompositorNodeTree");
|
|
|
|
break;
|
|
|
|
case NTREE_SHADER:
|
|
|
|
strcpy(snode->tree_idname, "ShaderNodeTree");
|
|
|
|
break;
|
|
|
|
case NTREE_TEXTURE:
|
|
|
|
strcpy(snode->tree_idname, "TextureNodeTree");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set flag for delayed do_versions in lib_verify_nodetree. It needs valid typeinfo pointers ... */
|
|
|
|
{
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* XXX This should be kept without version check for now!
|
|
|
|
* As long as USE_NODE_COMPAT_CUSTOMNODES is active, files will write links
|
|
|
|
* to tree interface sockets for forward compatibility. These links need to be removed again
|
|
|
|
* on file load in new versions.
|
|
|
|
* Once forward compatibility is not required any longer, make a subversion bump
|
|
|
|
* and only execute this for older versions.
|
|
|
|
*/
|
|
|
|
ntree->flag |= NTREE_DO_VERSIONS_CUSTOMNODES_GROUP;
|
|
|
|
|
|
|
|
/* Only add interface nodes once.
|
|
|
|
* In old Blender versions they will be removed automatically due to undefined type */
|
2018-06-05 15:10:33 +02:00
|
|
|
if (MAIN_VERSION_OLDER(bmain, 266, 2))
|
2013-11-29 23:16:13 +06:00
|
|
|
ntree->flag |= NTREE_DO_VERSIONS_CUSTOMNODES_GROUP_CREATE_INTERFACE;
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (MAIN_VERSION_OLDER(bmain, 266, 3)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
|
|
|
/* Fix for a very old issue:
|
|
|
|
* Node names were nominally made unique in r24478 (2.50.8), but the do_versions check
|
2018-06-05 15:10:33 +02:00
|
|
|
* to update existing node names only applied to bmain->nodetree (i.e. group nodes).
|
2013-11-29 23:16:13 +06:00
|
|
|
* Uniqueness is now required for proper preview mapping,
|
|
|
|
* so do this now to ensure old files don't break.
|
|
|
|
*/
|
|
|
|
bNode *node;
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (id == &ntree->id)
|
2018-11-30 14:51:16 +11:00
|
|
|
continue; /* already fixed for node groups */
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next)
|
|
|
|
nodeUniqueName(ntree, node);
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 266, 4)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Brush *brush;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
|
2015-03-29 03:16:55 +11:00
|
|
|
BKE_texture_mtex_default(&brush->mask_mtex);
|
2013-11-29 23:16:13 +06:00
|
|
|
|
|
|
|
if (brush->ob_mode & OB_MODE_TEXTURE_PAINT) {
|
|
|
|
brush->spacing /= 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 266, 6)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Brush *brush;
|
2013-12-22 14:11:10 +11:00
|
|
|
#define BRUSH_TEXTURE_OVERLAY (1 << 21)
|
2013-11-29 23:16:13 +06:00
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
brush->overlay_flags = 0;
|
|
|
|
if (brush->flag & BRUSH_TEXTURE_OVERLAY)
|
|
|
|
brush->overlay_flags |= (BRUSH_OVERLAY_PRIMARY | BRUSH_OVERLAY_CURSOR);
|
|
|
|
}
|
2013-12-22 14:11:10 +11:00
|
|
|
#undef BRUSH_TEXTURE_OVERLAY
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 267) {
|
2013-11-29 23:16:13 +06:00
|
|
|
//if (!DNA_struct_elem_find(fd->filesdna, "Brush", "int", "stencil_pos")) {
|
|
|
|
Brush *brush;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (brush->stencil_dimension[0] == 0) {
|
|
|
|
brush->stencil_dimension[0] = 256;
|
|
|
|
brush->stencil_dimension[1] = 256;
|
|
|
|
brush->stencil_pos[0] = 256;
|
|
|
|
brush->stencil_pos[1] = 256;
|
|
|
|
}
|
|
|
|
if (brush->mask_stencil_dimension[0] == 0) {
|
|
|
|
brush->mask_stencil_dimension[0] = 256;
|
|
|
|
brush->mask_stencil_dimension[1] = 256;
|
|
|
|
brush->mask_stencil_pos[0] = 256;
|
|
|
|
brush->mask_stencil_pos[1] = 256;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* TIP: to initialize new variables added, use the new function
|
|
|
|
* DNA_struct_elem_find(fd->filesdna, "structname", "typename", "varname")
|
|
|
|
* example:
|
|
|
|
* if (!DNA_struct_elem_find(fd->filesdna, "UserDef", "short", "image_gpubuffer_limit"))
|
|
|
|
* user->image_gpubuffer_limit = 10;
|
|
|
|
*/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* default values in Freestyle settings */
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 267) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Scene *sce;
|
|
|
|
SceneRenderLayer *srl;
|
|
|
|
FreestyleLineStyle *linestyle;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (sce->r.line_thickness_mode == 0) {
|
|
|
|
sce->r.line_thickness_mode = R_LINE_THICKNESS_ABSOLUTE;
|
|
|
|
sce->r.unit_line_thickness = 1.0f;
|
|
|
|
}
|
|
|
|
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
|
|
|
if (srl->freestyleConfig.mode == 0)
|
|
|
|
srl->freestyleConfig.mode = FREESTYLE_CONTROL_EDITOR_MODE;
|
|
|
|
if (srl->freestyleConfig.raycasting_algorithm == FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE ||
|
|
|
|
srl->freestyleConfig.raycasting_algorithm == FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL)
|
|
|
|
{
|
|
|
|
srl->freestyleConfig.raycasting_algorithm = 0; /* deprecated */
|
|
|
|
srl->freestyleConfig.flags |= FREESTYLE_CULLING;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* not freestyle */
|
|
|
|
{
|
|
|
|
MeshStatVis *statvis = &sce->toolsettings->statvis;
|
|
|
|
if (statvis->thickness_samples == 0) {
|
|
|
|
statvis->overhang_axis = OB_NEGZ;
|
|
|
|
statvis->overhang_min = 0;
|
|
|
|
statvis->overhang_max = DEG2RADF(45.0f);
|
|
|
|
|
|
|
|
statvis->thickness_max = 0.1f;
|
|
|
|
statvis->thickness_samples = 1;
|
|
|
|
|
|
|
|
statvis->distort_min = DEG2RADF(5.0f);
|
|
|
|
statvis->distort_max = DEG2RADF(45.0f);
|
|
|
|
|
|
|
|
statvis->sharp_min = DEG2RADF(90.0f);
|
|
|
|
statvis->sharp_max = DEG2RADF(180.0f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2019-03-08 09:29:17 +11:00
|
|
|
for (linestyle = bmain->linestyles.first; linestyle; linestyle = linestyle->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
#if 1
|
|
|
|
/* disable the Misc panel for now */
|
|
|
|
if (linestyle->panel == LS_PANEL_MISC) {
|
|
|
|
linestyle->panel = LS_PANEL_STROKES;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if (linestyle->thickness_position == 0) {
|
|
|
|
linestyle->thickness_position = LS_THICKNESS_CENTER;
|
|
|
|
linestyle->thickness_ratio = 0.5f;
|
|
|
|
}
|
|
|
|
if (linestyle->chaining == 0)
|
|
|
|
linestyle->chaining = LS_CHAINING_PLAIN;
|
|
|
|
if (linestyle->rounds == 0)
|
|
|
|
linestyle->rounds = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (bmain->versionfile < 267) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* Initialize the active_viewer_key for compositing */
|
|
|
|
bScreen *screen;
|
|
|
|
Scene *scene;
|
|
|
|
bNodeInstanceKey active_viewer_key = {0};
|
|
|
|
/* simply pick the first node space and use that for the active viewer key */
|
2019-03-08 09:29:17 +11:00
|
|
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ScrArea *sa;
|
|
|
|
for (sa = screen->areabase.first; sa; sa = sa->next) {
|
|
|
|
SpaceLink *sl;
|
|
|
|
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
|
|
|
if (sl->spacetype == SPACE_NODE) {
|
|
|
|
SpaceNode *snode = (SpaceNode *)sl;
|
|
|
|
bNodeTreePath *path = snode->treepath.last;
|
|
|
|
if (!path)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
active_viewer_key = path->parent_key;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (active_viewer_key.value != 0)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (active_viewer_key.value != 0)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* NB: scene->nodetree is a local ID block, has been direct_link'ed */
|
|
|
|
if (scene->nodetree)
|
|
|
|
scene->nodetree->active_viewer_key = active_viewer_key;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (MAIN_VERSION_OLDER(bmain, 267, 1)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Object *ob;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ModifierData *md;
|
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_Smoke) {
|
|
|
|
SmokeModifierData *smd = (SmokeModifierData *)md;
|
|
|
|
if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
|
|
|
|
if (smd->domain->flags & MOD_SMOKE_HIGH_SMOOTH) {
|
|
|
|
smd->domain->highres_sampling = SM_HRES_LINEAR;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
smd->domain->highres_sampling = SM_HRES_NEAREST;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 268, 1)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Brush *brush;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
brush->spacing = MAX2(1, brush->spacing);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 268, 2)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
Brush *brush;
|
2013-12-22 14:11:10 +11:00
|
|
|
#define BRUSH_FIXED (1 << 6)
|
2019-03-08 09:29:17 +11:00
|
|
|
for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
brush->flag &= ~BRUSH_FIXED;
|
|
|
|
|
|
|
|
if (brush->cursor_overlay_alpha < 2)
|
|
|
|
brush->cursor_overlay_alpha = 33;
|
|
|
|
if (brush->texture_overlay_alpha < 2)
|
|
|
|
brush->texture_overlay_alpha = 33;
|
|
|
|
if (brush->mask_overlay_alpha < 2)
|
|
|
|
brush->mask_overlay_alpha = 33;
|
|
|
|
}
|
2013-12-22 14:11:10 +11:00
|
|
|
#undef BRUSH_FIXED
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 268, 4)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
bScreen *sc;
|
|
|
|
Object *ob;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
bConstraint *con;
|
|
|
|
for (con = ob->constraints.first; con; con = con->next) {
|
|
|
|
if (con->type == CONSTRAINT_TYPE_SHRINKWRAP) {
|
|
|
|
bShrinkwrapConstraint *data = (bShrinkwrapConstraint *)con->data;
|
|
|
|
if (data->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) data->projAxis = OB_POSX;
|
|
|
|
else if (data->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) data->projAxis = OB_POSY;
|
|
|
|
else data->projAxis = OB_POSZ;
|
|
|
|
data->projAxisSpace = CONSTRAINT_SPACE_LOCAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ModifierData *md;
|
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_Smoke) {
|
|
|
|
SmokeModifierData *smd = (SmokeModifierData *)md;
|
|
|
|
if ((smd->type & MOD_SMOKE_TYPE_FLOW) && smd->flow) {
|
|
|
|
if (!smd->flow->particle_size) {
|
|
|
|
smd->flow->particle_size = 1.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* FIX some files have a zoom level of 0, and was checked during the drawing of the node space
|
|
|
|
*
|
|
|
|
* We moved this check to the do versions to be sure the value makes any sense.
|
|
|
|
*/
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ScrArea *sa;
|
|
|
|
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
|
|
|
SpaceLink *sl;
|
|
|
|
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
|
|
|
if (sl->spacetype == SPACE_NODE) {
|
|
|
|
SpaceNode *snode = (SpaceNode *)sl;
|
|
|
|
if (snode->zoom < 0.02f) {
|
|
|
|
snode->zoom = 1.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 268, 5)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
bScreen *sc;
|
|
|
|
ScrArea *sa;
|
|
|
|
|
|
|
|
/* add missing (+) expander in node editor */
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
|
|
|
ARegion *ar, *arnew;
|
|
|
|
|
|
|
|
if (sa->spacetype == SPACE_NODE) {
|
|
|
|
ar = BKE_area_find_region_type(sa, RGN_TYPE_TOOLS);
|
|
|
|
|
|
|
|
if (ar)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* add subdiv level; after header */
|
|
|
|
ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
|
|
|
|
|
|
|
|
/* is error! */
|
|
|
|
if (ar == NULL)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
arnew = MEM_callocN(sizeof(ARegion), "node tools");
|
|
|
|
|
|
|
|
BLI_insertlinkafter(&sa->regionbase, ar, arnew);
|
|
|
|
arnew->regiontype = RGN_TYPE_TOOLS;
|
|
|
|
arnew->alignment = RGN_ALIGN_LEFT;
|
|
|
|
|
|
|
|
arnew->flag = RGN_FLAG_HIDDEN;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 269, 1)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* Removal of Cycles SSS Compatible falloff */
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ntree->type == NTREE_SHADER) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == SH_NODE_SUBSURFACE_SCATTERING) {
|
|
|
|
if (node->custom1 == SHD_SUBSURFACE_COMPATIBLE) {
|
|
|
|
node->custom1 = SHD_SUBSURFACE_CUBIC;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 269, 2)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* Initialize CDL settings for Color Balance nodes */
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
2013-11-29 23:16:13 +06:00
|
|
|
if (ntree->type == NTREE_COMPOSIT) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_COLORBALANCE) {
|
|
|
|
NodeColorBalance *n = node->storage;
|
|
|
|
if (node->custom1 == 0) {
|
|
|
|
/* LGG mode stays the same, just init CDL settings */
|
|
|
|
ntreeCompositColorBalanceSyncFromLGG(ntree, node);
|
|
|
|
}
|
|
|
|
else if (node->custom1 == 1) {
|
|
|
|
/* CDL previously used same variables as LGG, copy them over
|
|
|
|
* and then sync LGG for comparable results in both modes.
|
|
|
|
*/
|
|
|
|
copy_v3_v3(n->offset, n->lift);
|
|
|
|
copy_v3_v3(n->power, n->gamma);
|
|
|
|
copy_v3_v3(n->slope, n->gain);
|
|
|
|
ntreeCompositColorBalanceSyncFromCDL(ntree, node);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 269, 3)) {
|
2013-11-29 23:16:13 +06:00
|
|
|
bScreen *sc;
|
|
|
|
ScrArea *sa;
|
|
|
|
SpaceLink *sl;
|
|
|
|
Scene *scene;
|
|
|
|
|
|
|
|
/* Update files using invalid (outdated) outlinevis Outliner values. */
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
|
|
|
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
|
|
|
if (sl->spacetype == SPACE_OUTLINER) {
|
2019-02-16 09:47:19 +11:00
|
|
|
SpaceOutliner *so = (SpaceOutliner *)sl;
|
2013-11-29 23:16:13 +06:00
|
|
|
|
Outliner Filtering System + Cleanup
User notes:
The outliner so far was a great system to handle the object oriented workflow
we had in Blender prior to 2.8. However with the introduction of collections
the bloated ammount of data we were exposed at a given time was eventually
getting on the way of fully utilizing the outliner to manage collections and
their objects.
We hope that with this filtering system the user can put together the outliner
with whichever options he or she seem fit for a given task.
Features:
* Collection filter: In case users are only focused on objects.
* Object filter: Allow users to focus on collections only.
* (Object) content filter: Modifiers, mesh, contrainst, materials, ...
* (Object) children filter: Hide object children [1].
* Object State (visible, active, selected).
* Compact header: hide search options under a search toggle.
* Preserve scrolling position before/after filtering [2].
[1] - Note we still need to be able to tell if a children of an object is in a
collection, or if the parent object is the only one in the collection.
This in fact was one of the first motivations for this patch. But it is to
be addressed separately now that we can at least hide children away.
[2] - We look at the top-most collection in the outliner, and try to find it again
after the filtering and make sure it is in the same position as before.
This works nice now. But to work REALLY, REALLY nice we need to also store
the previous filter options to be sure the element we try to keep on top
was valid for both old and new filters. I would rather do this later though
since this smell a lot like feature creeping ;)
Remove no longer needed display options:
* Current Scene (replaced by View Layer/Collections)
* Visible (replaced by filter)
* Selected (same)
* Active (same)
* Same Type (same-ish)
How about All Scenes? I have a patch that will come next to replace the current
behaviour and focus only on compositing. So basically stop showing the objects
and show only view layers, their passes and collections, besides freestyle.
Also, while at this I'm also reorganizing the menu to keep View Layer and
Collections on top.
Developer notes:
* Unlike the per-object filtering, for collections we need to filter at tree
creation time, to prevent duplication of objects in the outliner.
Acknowledgements:
Thanks Pablo Vazquez for helping testing, thinking some design questions
together and pushing this to its final polished state as you see here.
Thanks Sergey Sharybin and Julian Eisel for code review. Julian couldn't do a
final review pass after I addressed his concerns. So blame is on me for any
issue I may be introducing here. Sergey was the author of the "preserve
scrolling position" idea. I'm happy with how it is working, thank you.
Reviewers: sergey, Severin, venomgfx
Subscribers: lichtwerk, duarteframos
Differential Revision: https://developer.blender.org/D2992
2018-01-19 11:39:54 -02:00
|
|
|
if (!ELEM(so->outlinevis,
|
2018-01-18 18:30:30 -02:00
|
|
|
SO_SCENES,
|
Outliner Filtering System + Cleanup
User notes:
The outliner so far was a great system to handle the object oriented workflow
we had in Blender prior to 2.8. However with the introduction of collections
the bloated ammount of data we were exposed at a given time was eventually
getting on the way of fully utilizing the outliner to manage collections and
their objects.
We hope that with this filtering system the user can put together the outliner
with whichever options he or she seem fit for a given task.
Features:
* Collection filter: In case users are only focused on objects.
* Object filter: Allow users to focus on collections only.
* (Object) content filter: Modifiers, mesh, contrainst, materials, ...
* (Object) children filter: Hide object children [1].
* Object State (visible, active, selected).
* Compact header: hide search options under a search toggle.
* Preserve scrolling position before/after filtering [2].
[1] - Note we still need to be able to tell if a children of an object is in a
collection, or if the parent object is the only one in the collection.
This in fact was one of the first motivations for this patch. But it is to
be addressed separately now that we can at least hide children away.
[2] - We look at the top-most collection in the outliner, and try to find it again
after the filtering and make sure it is in the same position as before.
This works nice now. But to work REALLY, REALLY nice we need to also store
the previous filter options to be sure the element we try to keep on top
was valid for both old and new filters. I would rather do this later though
since this smell a lot like feature creeping ;)
Remove no longer needed display options:
* Current Scene (replaced by View Layer/Collections)
* Visible (replaced by filter)
* Selected (same)
* Active (same)
* Same Type (same-ish)
How about All Scenes? I have a patch that will come next to replace the current
behaviour and focus only on compositing. So basically stop showing the objects
and show only view layers, their passes and collections, besides freestyle.
Also, while at this I'm also reorganizing the menu to keep View Layer and
Collections on top.
Developer notes:
* Unlike the per-object filtering, for collections we need to filter at tree
creation time, to prevent duplication of objects in the outliner.
Acknowledgements:
Thanks Pablo Vazquez for helping testing, thinking some design questions
together and pushing this to its final polished state as you see here.
Thanks Sergey Sharybin and Julian Eisel for code review. Julian couldn't do a
final review pass after I addressed his concerns. So blame is on me for any
issue I may be introducing here. Sergey was the author of the "preserve
scrolling position" idea. I'm happy with how it is working, thank you.
Reviewers: sergey, Severin, venomgfx
Subscribers: lichtwerk, duarteframos
Differential Revision: https://developer.blender.org/D2992
2018-01-19 11:39:54 -02:00
|
|
|
SO_LIBRARIES,
|
|
|
|
SO_SEQUENCE,
|
2018-05-17 12:20:10 +02:00
|
|
|
SO_DATA_API))
|
2013-11-29 23:16:13 +06:00
|
|
|
{
|
2018-01-18 18:30:30 -02:00
|
|
|
so->outlinevis = SO_SCENES;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingTrack", "float", "weight")) {
|
|
|
|
MovieClip *clip;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (clip = bmain->movieclips.first; clip; clip = clip->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
MovieTrackingObject *tracking_object;
|
|
|
|
for (tracking_object = tracking->objects.first;
|
|
|
|
tracking_object;
|
|
|
|
tracking_object = tracking_object->next)
|
|
|
|
{
|
|
|
|
ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, tracking_object);
|
|
|
|
MovieTrackingTrack *track;
|
|
|
|
for (track = tracksbase->first;
|
|
|
|
track;
|
|
|
|
track = track->next)
|
|
|
|
{
|
|
|
|
track->weight = 1.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!DNA_struct_elem_find(fd->filesdna, "TriangulateModifierData", "int", "quad_method")) {
|
|
|
|
Object *ob;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
ModifierData *md;
|
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_Triangulate) {
|
|
|
|
TriangulateModifierData *tmd = (TriangulateModifierData *)md;
|
|
|
|
if ((tmd->flag & MOD_TRIANGULATE_BEAUTY)) {
|
|
|
|
tmd->quad_method = MOD_TRIANGULATE_QUAD_BEAUTY;
|
|
|
|
tmd->ngon_method = MOD_TRIANGULATE_NGON_BEAUTY;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
tmd->quad_method = MOD_TRIANGULATE_QUAD_FIXED;
|
2014-02-21 15:03:34 +11:00
|
|
|
tmd->ngon_method = MOD_TRIANGULATE_NGON_EARCLIP;
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-11-29 23:16:13 +06:00
|
|
|
/* this can now be turned off */
|
|
|
|
ToolSettings *ts = scene->toolsettings;
|
|
|
|
if (ts->sculpt)
|
|
|
|
ts->sculpt->flags |= SCULPT_DYNTOPO_SUBDIVIDE;
|
|
|
|
|
|
|
|
/* 'Increment' mode disabled for nodes, use true grid snapping instead */
|
|
|
|
if (scene->toolsettings->snap_node_mode == SCE_SNAP_MODE_INCREMENT)
|
|
|
|
scene->toolsettings->snap_node_mode = SCE_SNAP_MODE_GRID;
|
|
|
|
|
|
|
|
#ifdef WITH_FFMPEG
|
|
|
|
/* Update for removed "sound-only" option in FFMPEG export settings. */
|
|
|
|
if (scene->r.ffcodecdata.type >= FFMPEG_INVALID) {
|
|
|
|
scene->r.ffcodecdata.type = FFMPEG_AVI;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2013-11-29 23:26:57 +06:00
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 269, 4)) {
|
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
|
|
|
/* Internal degrees to radians conversions... */
|
|
|
|
{
|
|
|
|
Scene *scene;
|
|
|
|
Object *ob;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (Light *la = bmain->lights.first; la; la = la->id.next) {
|
2019-02-27 10:46:48 +11:00
|
|
|
la->spotsize = DEG2RADF(la->spotsize);
|
|
|
|
}
|
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
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
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
|
|
|
ModifierData *md;
|
|
|
|
|
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_EdgeSplit) {
|
|
|
|
EdgeSplitModifierData *emd = (EdgeSplitModifierData *)md;
|
|
|
|
emd->split_angle = DEG2RADF(emd->split_angle);
|
|
|
|
}
|
|
|
|
else if (md->type == eModifierType_Bevel) {
|
|
|
|
BevelModifierData *bmd = (BevelModifierData *)md;
|
|
|
|
bmd->bevel_angle = DEG2RADF(bmd->bevel_angle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
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
|
|
|
Sequence *seq;
|
|
|
|
SEQ_BEGIN (scene->ed, seq)
|
|
|
|
{
|
|
|
|
if (seq->type == SEQ_TYPE_WIPE) {
|
|
|
|
WipeVars *wv = seq->effectdata;
|
|
|
|
wv->angle = DEG2RADF(wv->angle);
|
|
|
|
}
|
2018-11-30 15:35:15 +11:00
|
|
|
} SEQ_END;
|
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
|
|
|
}
|
|
|
|
|
2018-11-30 15:22:01 +11:00
|
|
|
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
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
|
|
|
if (ntree->type == NTREE_COMPOSIT) {
|
|
|
|
bNode *node;
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
if (node->type == CMP_NODE_BOKEHIMAGE) {
|
|
|
|
NodeBokehImage *n = node->storage;
|
|
|
|
n->angle = DEG2RADF(n->angle);
|
|
|
|
}
|
|
|
|
if (node->type == CMP_NODE_MASK_BOX) {
|
|
|
|
NodeBoxMask *n = node->storage;
|
|
|
|
n->rotation = DEG2RADF(n->rotation);
|
|
|
|
}
|
|
|
|
if (node->type == CMP_NODE_MASK_ELLIPSE) {
|
|
|
|
NodeEllipseMask *n = node->storage;
|
|
|
|
n->rotation = DEG2RADF(n->rotation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-30 15:22:01 +11:00
|
|
|
} FOREACH_NODETREE_END;
|
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
|
|
|
}
|
|
|
|
|
2013-11-29 23:26:57 +06:00
|
|
|
if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingPlaneTrack", "float", "image_opacity")) {
|
|
|
|
MovieClip *clip;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (clip = bmain->movieclips.first; clip; clip = clip->id.next) {
|
2013-11-29 23:26:57 +06:00
|
|
|
MovieTrackingPlaneTrack *plane_track;
|
|
|
|
for (plane_track = clip->tracking.plane_tracks.first;
|
|
|
|
plane_track;
|
|
|
|
plane_track = plane_track->next)
|
|
|
|
{
|
|
|
|
plane_track->image_opacity = 1.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-12-09 22:36:33 +02:00
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 269, 7)) {
|
2013-12-09 22:36:33 +02:00
|
|
|
Scene *scene;
|
2019-03-08 09:29:17 +11:00
|
|
|
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
2013-12-09 22:36:33 +02:00
|
|
|
Sculpt *sd = scene->toolsettings->sculpt;
|
|
|
|
|
|
|
|
if (sd) {
|
2018-12-17 13:21:49 +11:00
|
|
|
enum {
|
|
|
|
SCULPT_SYMM_X = (1 << 0),
|
|
|
|
SCULPT_SYMM_Y = (1 << 1),
|
|
|
|
SCULPT_SYMM_Z = (1 << 2),
|
2019-02-08 09:29:08 +11:00
|
|
|
SCULPT_SYMMETRY_FEATHER = (1 << 6),
|
2018-12-17 13:21:49 +11:00
|
|
|
};
|
2013-12-09 22:36:33 +02:00
|
|
|
int symmetry_flags = sd->flags & 7;
|
|
|
|
|
|
|
|
if (symmetry_flags & SCULPT_SYMM_X)
|
|
|
|
sd->paint.symmetry_flags |= PAINT_SYMM_X;
|
|
|
|
if (symmetry_flags & SCULPT_SYMM_Y)
|
|
|
|
sd->paint.symmetry_flags |= PAINT_SYMM_Y;
|
|
|
|
if (symmetry_flags & SCULPT_SYMM_Z)
|
|
|
|
sd->paint.symmetry_flags |= PAINT_SYMM_Z;
|
|
|
|
if (symmetry_flags & SCULPT_SYMMETRY_FEATHER)
|
|
|
|
sd->paint.symmetry_flags |= PAINT_SYMMETRY_FEATHER;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-01-03 17:04:42 +11:00
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 269, 8)) {
|
2014-01-03 17:04:42 +11:00
|
|
|
Curve *cu;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (cu = bmain->curves.first; cu; cu = cu->id.next) {
|
2014-01-03 17:04:42 +11:00
|
|
|
if (cu->str) {
|
|
|
|
cu->len_wchar = BLI_strlen_utf8(cu->str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-06-17 17:06:07 +02:00
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 269, 9)) {
|
2014-01-17 00:13:36 +13:00
|
|
|
Object *ob;
|
2018-06-17 17:06:07 +02:00
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
2014-01-17 00:13:36 +13:00
|
|
|
ModifierData *md;
|
|
|
|
for (md = ob->modifiers.first; md; md = md->next) {
|
|
|
|
if (md->type == eModifierType_Build) {
|
|
|
|
BuildModifierData *bmd = (BuildModifierData *)md;
|
|
|
|
if (bmd->randomize) {
|
|
|
|
bmd->flag |= MOD_BUILD_FLAG_RANDOMIZE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-01-14 11:00:44 -05:00
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
if (!MAIN_VERSION_ATLEAST(bmain, 269, 11)) {
|
2014-02-13 19:49:26 +02:00
|
|
|
bScreen *sc;
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
2014-02-13 19:49:26 +02:00
|
|
|
ScrArea *sa;
|
|
|
|
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
|
|
|
SpaceLink *space_link;
|
|
|
|
|
|
|
|
for (space_link = sa->spacedata.first; space_link; space_link = space_link->next) {
|
|
|
|
if (space_link->spacetype == SPACE_IMAGE) {
|
|
|
|
ARegion *ar;
|
|
|
|
ListBase *lb;
|
|
|
|
|
|
|
|
if (space_link == sa->spacedata.first) {
|
|
|
|
lb = &sa->regionbase;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
lb = &space_link->regionbase;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (ar = lb->first; ar; ar = ar->next) {
|
|
|
|
if (ar->regiontype == RGN_TYPE_PREVIEW) {
|
|
|
|
ar->regiontype = RGN_TYPE_TOOLS;
|
|
|
|
ar->alignment = RGN_ALIGN_LEFT;
|
|
|
|
}
|
|
|
|
else if (ar->regiontype == RGN_TYPE_UI) {
|
|
|
|
ar->alignment = RGN_ALIGN_RIGHT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-11-29 23:16:13 +06:00
|
|
|
}
|