Merge branch 'master' into blender2.8
This commit is contained in:
commit
0d64857c3f
@ -1124,7 +1124,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob,
|
||||
bool attribute_recalc = false;
|
||||
|
||||
foreach(Shader *shader, mesh->used_shaders)
|
||||
if(shader->need_update_attributes)
|
||||
if(shader->need_update_mesh)
|
||||
attribute_recalc = true;
|
||||
|
||||
if(!attribute_recalc)
|
||||
|
@ -247,7 +247,7 @@ public:
|
||||
|
||||
void alloc_to_device(size_t num, bool shrink_to_fit = true)
|
||||
{
|
||||
size_t new_size = num*sizeof(T);
|
||||
size_t new_size = num;
|
||||
bool reallocate;
|
||||
|
||||
if(shrink_to_fit) {
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "graph/node_type.h"
|
||||
|
||||
#include "util/util_foreach.h"
|
||||
#include "util/util_md5.h"
|
||||
#include "util/util_param.h"
|
||||
#include "util/util_transform.h"
|
||||
|
||||
@ -403,5 +404,24 @@ bool Node::equals(const Node& other) const
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Hash */
|
||||
|
||||
void Node::hash(MD5Hash& md5)
|
||||
{
|
||||
md5.append(type->name.string());
|
||||
|
||||
foreach(const SocketType& socket, type->inputs) {
|
||||
md5.append(socket.name.string());
|
||||
|
||||
if(socket.is_array()) {
|
||||
const array<bool>* a = (const array<bool>*)(((char*)this) + socket.struct_offset);
|
||||
md5.append((uint8_t*)a->data(), socket.size() * a->size());
|
||||
}
|
||||
else {
|
||||
md5.append(((uint8_t*)this) + socket.struct_offset, socket.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
class MD5Hash;
|
||||
struct Node;
|
||||
struct NodeType;
|
||||
struct Transform;
|
||||
@ -88,6 +89,9 @@ struct Node
|
||||
/* equals */
|
||||
bool equals(const Node& other) const;
|
||||
|
||||
/* compute hash of node and its socket values */
|
||||
void hash(MD5Hash& md5);
|
||||
|
||||
ustring name;
|
||||
const NodeType *type;
|
||||
};
|
||||
|
@ -179,13 +179,13 @@ ccl_device_inline float path_state_continuation_probability(KernelGlobals *kg,
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
/* Test max bounces for various ray types.
|
||||
The check for max_volume_bounce doesn't happen here but inside volume_shader_sample().
|
||||
See T53914.
|
||||
*/
|
||||
/* Test max bounces for various ray types. */
|
||||
if((state->bounce >= kernel_data.integrator.max_bounce) ||
|
||||
(state->diffuse_bounce >= kernel_data.integrator.max_diffuse_bounce) ||
|
||||
(state->glossy_bounce >= kernel_data.integrator.max_glossy_bounce) ||
|
||||
#ifdef __VOLUME__
|
||||
(state->volume_bounce >= kernel_data.integrator.max_volume_bounce) ||
|
||||
#endif
|
||||
(state->transmission_bounce >= kernel_data.integrator.max_transmission_bounce))
|
||||
{
|
||||
return 0.0f;
|
||||
|
@ -496,7 +496,7 @@ void Film::tag_passes_update(Scene *scene, const array<Pass>& passes_)
|
||||
scene->mesh_manager->tag_update(scene);
|
||||
|
||||
foreach(Shader *shader, scene->shaders)
|
||||
shader->need_update_attributes = true;
|
||||
shader->need_update_mesh = true;
|
||||
}
|
||||
else if(Pass::contains(passes, PASS_MOTION) != Pass::contains(passes_, PASS_MOTION))
|
||||
scene->mesh_manager->tag_update(scene);
|
||||
|
@ -23,8 +23,9 @@
|
||||
|
||||
#include "util/util_algorithm.h"
|
||||
#include "util/util_foreach.h"
|
||||
#include "util/util_queue.h"
|
||||
#include "util/util_logging.h"
|
||||
#include "util/util_md5.h"
|
||||
#include "util/util_queue.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
@ -683,6 +684,32 @@ void ShaderGraph::break_cycles(ShaderNode *node, vector<bool>& visited, vector<b
|
||||
on_stack[node->id] = false;
|
||||
}
|
||||
|
||||
void ShaderGraph::compute_displacement_hash()
|
||||
{
|
||||
/* Compute hash of all nodes linked to displacement, to detect if we need
|
||||
* to recompute displacement when shader nodes change. */
|
||||
ShaderInput *displacement_in = output()->input("Displacement");
|
||||
|
||||
if(!displacement_in->link) {
|
||||
displacement_hash = "";
|
||||
return;
|
||||
}
|
||||
|
||||
ShaderNodeSet nodes_displace;
|
||||
find_dependencies(nodes_displace, displacement_in);
|
||||
|
||||
MD5Hash md5;
|
||||
foreach(ShaderNode *node, nodes_displace) {
|
||||
node->hash(md5);
|
||||
foreach(ShaderInput *input, node->inputs) {
|
||||
int link_id = (input->link) ? input->link->parent->id : 0;
|
||||
md5.append((uint8_t*)&link_id, sizeof(link_id));
|
||||
}
|
||||
}
|
||||
|
||||
displacement_hash = md5.get_hex();
|
||||
}
|
||||
|
||||
void ShaderGraph::clean(Scene *scene)
|
||||
{
|
||||
/* Graph simplification */
|
||||
|
@ -42,6 +42,7 @@ class SVMCompiler;
|
||||
class OSLCompiler;
|
||||
class OutputNode;
|
||||
class ConstantFolder;
|
||||
class MD5Hash;
|
||||
|
||||
/* Bump
|
||||
*
|
||||
@ -243,6 +244,7 @@ public:
|
||||
size_t num_node_ids;
|
||||
bool finalized;
|
||||
bool simplified;
|
||||
string displacement_hash;
|
||||
|
||||
ShaderGraph();
|
||||
~ShaderGraph();
|
||||
@ -256,6 +258,7 @@ public:
|
||||
void relink(ShaderNode *node, ShaderOutput *from, ShaderOutput *to);
|
||||
|
||||
void remove_proxy_nodes();
|
||||
void compute_displacement_hash();
|
||||
void simplify(Scene *scene);
|
||||
void finalize(Scene *scene,
|
||||
bool do_bump = false,
|
||||
|
@ -1964,7 +1964,7 @@ void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scen
|
||||
/* Update normals. */
|
||||
foreach(Mesh *mesh, scene->meshes) {
|
||||
foreach(Shader *shader, mesh->used_shaders) {
|
||||
if(shader->need_update_attributes)
|
||||
if(shader->need_update_mesh)
|
||||
mesh->need_update = true;
|
||||
}
|
||||
|
||||
@ -2104,7 +2104,7 @@ void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scen
|
||||
<< summary.full_report();
|
||||
|
||||
foreach(Shader *shader, scene->shaders) {
|
||||
shader->need_update_attributes = false;
|
||||
shader->need_update_mesh = false;
|
||||
}
|
||||
|
||||
Scene::MotionType need_motion = scene->need_motion();
|
||||
|
@ -200,7 +200,7 @@ Shader::Shader()
|
||||
used = false;
|
||||
|
||||
need_update = true;
|
||||
need_update_attributes = true;
|
||||
need_update_mesh = true;
|
||||
}
|
||||
|
||||
Shader::~Shader()
|
||||
@ -235,9 +235,24 @@ void Shader::set_graph(ShaderGraph *graph_)
|
||||
/* do this here already so that we can detect if mesh or object attributes
|
||||
* are needed, since the node attribute callbacks check if their sockets
|
||||
* are connected but proxy nodes should not count */
|
||||
if(graph_)
|
||||
if(graph_) {
|
||||
graph_->remove_proxy_nodes();
|
||||
|
||||
if(displacement_method != DISPLACE_BUMP) {
|
||||
graph_->compute_displacement_hash();
|
||||
}
|
||||
}
|
||||
|
||||
/* update geometry if displacement changed */
|
||||
if(displacement_method != DISPLACE_BUMP) {
|
||||
const char *old_hash = (graph)? graph->displacement_hash.c_str() : "";
|
||||
const char *new_hash = (graph_)? graph_->displacement_hash.c_str() : "";
|
||||
|
||||
if(strcmp(old_hash, new_hash) != 0) {
|
||||
need_update_mesh = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* assign graph */
|
||||
delete graph;
|
||||
graph = graph_;
|
||||
@ -294,9 +309,9 @@ void Shader::tag_update(Scene *scene)
|
||||
}
|
||||
|
||||
/* compare if the attributes changed, mesh manager will check
|
||||
* need_update_attributes, update the relevant meshes and clear it. */
|
||||
* need_update_mesh, update the relevant meshes and clear it. */
|
||||
if(attributes.modified(prev_attributes)) {
|
||||
need_update_attributes = true;
|
||||
need_update_mesh = true;
|
||||
scene->mesh_manager->need_update = true;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
|
||||
/* synchronization */
|
||||
bool need_update;
|
||||
bool need_update_attributes;
|
||||
bool need_update_mesh;
|
||||
|
||||
/* If the shader has only volume components, the surface is assumed to
|
||||
* be transparent.
|
||||
|
@ -310,6 +310,13 @@ void MD5Hash::append(const uint8_t *data, int nbytes)
|
||||
memcpy(buf, p, left);
|
||||
}
|
||||
|
||||
void MD5Hash::append(const string& str)
|
||||
{
|
||||
if(str.size()) {
|
||||
append((const uint8_t*)str.c_str(), str.size());
|
||||
}
|
||||
}
|
||||
|
||||
bool MD5Hash::append_file(const string& filepath)
|
||||
{
|
||||
FILE *f = path_fopen(filepath, "rb");
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
~MD5Hash();
|
||||
|
||||
void append(const uint8_t *data, int size);
|
||||
void append(const string& str);
|
||||
bool append_file(const string& filepath);
|
||||
string get_hex();
|
||||
|
||||
|
@ -107,6 +107,14 @@ add_definitions(
|
||||
-DNEWDIRVELMOTEST=0
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
# We need BLI_gzopen on win32 for unicode paths
|
||||
add_definitions(
|
||||
-DLBM_GZIP_OVERRIDE_H="${CMAKE_SOURCE_DIR}/source/blender/blenlib/BLI_fileops.h"
|
||||
-D LBM_GZIP_OPEN_FN="\(gzFile\)BLI_gzopen"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENMP)
|
||||
add_definitions(-DPARALLEL=1)
|
||||
else()
|
||||
|
@ -22,7 +22,11 @@
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
|
||||
#ifdef LBM_GZIP_OVERRIDE_H
|
||||
# include LBM_GZIP_OVERRIDE_H
|
||||
#else
|
||||
# define LBM_GZIP_OPEN_FN(a, b) gzopen(a, b)
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
* Constructor
|
||||
@ -141,7 +145,8 @@ int ntlBlenderDumper::renderScene( void )
|
||||
std::ostringstream bvelfilename;
|
||||
bvelfilename << boutfilename.str();
|
||||
bvelfilename << ".bvel.gz";
|
||||
gzf = gzopen(bvelfilename.str().c_str(), "wb9");
|
||||
/* wraps gzopen */
|
||||
gzf = LBM_GZIP_OPEN_FN(bvelfilename.str().c_str(), "wb9");
|
||||
if(gzf) {
|
||||
int numVerts;
|
||||
if(sizeof(numVerts)!=4) { errMsg("ntlBlenderDumper::renderScene","Invalid int size"); return 1; }
|
||||
@ -162,7 +167,8 @@ int ntlBlenderDumper::renderScene( void )
|
||||
|
||||
// compress all bobj's
|
||||
boutfilename << ".bobj.gz";
|
||||
gzf = gzopen(boutfilename.str().c_str(), "wb1"); // wb9 is slow for large meshes!
|
||||
/* wraps gzopen */
|
||||
gzf = LBM_GZIP_OPEN_FN(boutfilename.str().c_str(), "wb1"); // wb9 is slow for large meshes!
|
||||
if (!gzf) {
|
||||
errMsg("ntlBlenderDumper::renderScene","Unable to open output '" + boutfilename.str() + "' ");
|
||||
return 1; }
|
||||
|
@ -256,6 +256,7 @@ void BKE_sculpt_update_mesh_elements(
|
||||
struct MultiresModifierData *BKE_sculpt_multires_active(struct Scene *scene, struct Object *ob);
|
||||
int BKE_sculpt_mask_layers_ensure(struct Object *ob,
|
||||
struct MultiresModifierData *mmd);
|
||||
void BKE_sculpt_toolsettings_data_ensure(struct Scene *scene);
|
||||
|
||||
enum {
|
||||
SCULPT_MASK_LAYER_CALC_VERT = (1 << 0),
|
||||
|
@ -1064,3 +1064,39 @@ int BKE_sculpt_mask_layers_ensure(Object *ob, MultiresModifierData *mmd)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void BKE_sculpt_toolsettings_data_ensure(struct Scene *scene)
|
||||
{
|
||||
Sculpt *sd = scene->toolsettings->sculpt;
|
||||
if (sd == NULL) {
|
||||
sd = scene->toolsettings->sculpt = MEM_callocN(sizeof(Sculpt), __func__);
|
||||
|
||||
/* Turn on X plane mirror symmetry by default */
|
||||
sd->paint.symmetry_flags |= PAINT_SYMM_X;
|
||||
sd->paint.flags |= PAINT_SHOW_BRUSH;
|
||||
|
||||
/* Make sure at least dyntopo subdivision is enabled */
|
||||
sd->flags |= SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE;
|
||||
}
|
||||
|
||||
if (!sd->detail_size) {
|
||||
sd->detail_size = 12;
|
||||
}
|
||||
if (!sd->detail_percent) {
|
||||
sd->detail_percent = 25;
|
||||
}
|
||||
if (sd->constant_detail == 0.0f) {
|
||||
sd->constant_detail = 3.0f;
|
||||
}
|
||||
|
||||
/* Set sane default tiling offsets */
|
||||
if (!sd->paint.tile_offset[0]) {
|
||||
sd->paint.tile_offset[0] = 1.0f;
|
||||
}
|
||||
if (!sd->paint.tile_offset[1]) {
|
||||
sd->paint.tile_offset[1] = 1.0f;
|
||||
}
|
||||
if (!sd->paint.tile_offset[2]) {
|
||||
sd->paint.tile_offset[2] = 1.0f;
|
||||
}
|
||||
}
|
||||
|
@ -1985,6 +1985,7 @@ static bool adjust_the_cycle_or_chain_fast(BoundVert *vstart, int np, bool iscyc
|
||||
g_prod[i] = gprod;
|
||||
gprod_sum += gprod;
|
||||
}
|
||||
g_prod[0] = 1.0f;
|
||||
if (iscycle) {
|
||||
gprod *= g[0];
|
||||
if (fabs(gprod - 1.0f) > BEVEL_EPSILON) {
|
||||
@ -1993,8 +1994,6 @@ static bool adjust_the_cycle_or_chain_fast(BoundVert *vstart, int np, bool iscyc
|
||||
MEM_freeN(g_prod);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
g_prod[0] = 1.0f;
|
||||
}
|
||||
if (gprod_sum == 0.0f) {
|
||||
MEM_freeN(g);
|
||||
@ -2163,7 +2162,7 @@ static void adjust_offsets(BevelParams *bp)
|
||||
/* first follow paired edges in left->right direction */
|
||||
v = vchainstart = vanchor;
|
||||
iscycle = false;
|
||||
while(v->eon && !v->visited && !iscycle) {
|
||||
while (v->eon && !v->visited && !iscycle) {
|
||||
enext = find_other_end_edge_half(bp, v->efirst, &bvcur);
|
||||
BLI_assert(enext != NULL);
|
||||
vnext = enext->leftv;
|
||||
@ -2191,7 +2190,7 @@ static void adjust_offsets(BevelParams *bp)
|
||||
vchainstart = vnext;
|
||||
v->visited = true;
|
||||
v = vnext;
|
||||
} while(!v->visited && v->eon);
|
||||
} while (!v->visited && v->eon);
|
||||
adjust_the_cycle_or_chain(vchainstart, false);
|
||||
}
|
||||
} while ((vanchor = vanchor->next) != bv->vmesh->boundstart);
|
||||
|
@ -347,8 +347,8 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object)
|
||||
object_cow),
|
||||
DEG_OPCODE_POSE_INIT);
|
||||
op_node->set_as_entry();
|
||||
BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object_cow->pose->chanbase) {
|
||||
/* Local bone transform. */
|
||||
|
||||
BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
|
||||
op_node = add_operation_node(&object->id,
|
||||
DEG_NODE_TYPE_BONE,
|
||||
pchan->name,
|
||||
|
@ -939,18 +939,7 @@ void DepsgraphRelationBuilder::build_animdata_curves(ID *id)
|
||||
ComponentKey adt_key(id, DEG_NODE_TYPE_ANIMATION);
|
||||
TimeSourceKey time_src_key;
|
||||
add_relation(time_src_key, adt_key, "TimeSrc -> Animation");
|
||||
/* Build relations from animation operation to properties it changes. */
|
||||
build_animdata_curves_targets(id);
|
||||
}
|
||||
|
||||
void DepsgraphRelationBuilder::build_animdata_curves_targets(ID *id)
|
||||
{
|
||||
AnimData *adt = BKE_animdata_from_id(id);
|
||||
if (adt == NULL || adt->action == NULL) {
|
||||
return;
|
||||
}
|
||||
/* Get source operation. */
|
||||
ComponentKey adt_key(id, DEG_NODE_TYPE_ANIMATION);
|
||||
/* Get source operations. */
|
||||
DepsNode *node_from = get_node(adt_key);
|
||||
BLI_assert(node_from != NULL);
|
||||
if (node_from == NULL) {
|
||||
@ -958,10 +947,28 @@ void DepsgraphRelationBuilder::build_animdata_curves_targets(ID *id)
|
||||
}
|
||||
OperationDepsNode *operation_from = node_from->get_exit_operation();
|
||||
BLI_assert(operation_from != NULL);
|
||||
/* Build relations from animation operation to properties it changes. */
|
||||
if (adt->action != NULL) {
|
||||
build_animdata_curves_targets(id, adt_key,
|
||||
operation_from,
|
||||
&adt->action->curves);
|
||||
}
|
||||
BLI_LISTBASE_FOREACH(NlaTrack *, nlt, &adt->nla_tracks) {
|
||||
build_animdata_nlastrip_targets(id, adt_key,
|
||||
operation_from,
|
||||
&nlt->strips);
|
||||
}
|
||||
}
|
||||
|
||||
void DepsgraphRelationBuilder::build_animdata_curves_targets(
|
||||
ID *id, ComponentKey &adt_key,
|
||||
OperationDepsNode *operation_from,
|
||||
ListBase *curves)
|
||||
{
|
||||
/* Iterate over all curves and build relations. */
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
BLI_LISTBASE_FOREACH (FCurve *, fcu, &adt->action->curves) {
|
||||
BLI_LISTBASE_FOREACH(FCurve *, fcu, curves) {
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
int index;
|
||||
@ -1004,6 +1011,25 @@ void DepsgraphRelationBuilder::build_animdata_curves_targets(ID *id)
|
||||
}
|
||||
}
|
||||
|
||||
void DepsgraphRelationBuilder::build_animdata_nlastrip_targets(
|
||||
ID *id, ComponentKey &adt_key,
|
||||
OperationDepsNode *operation_from,
|
||||
ListBase *strips)
|
||||
{
|
||||
BLI_LISTBASE_FOREACH(NlaStrip *, strip, strips) {
|
||||
if (strip->act != NULL) {
|
||||
build_animdata_curves_targets(id, adt_key,
|
||||
operation_from,
|
||||
&strip->act->curves);
|
||||
}
|
||||
else if (strip->strips.first != NULL) {
|
||||
build_animdata_nlastrip_targets(id, adt_key,
|
||||
operation_from,
|
||||
&strip->strips);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DepsgraphRelationBuilder::build_animdata_drivers(ID *id)
|
||||
{
|
||||
AnimData *adt = BKE_animdata_from_id(id);
|
||||
|
@ -205,7 +205,14 @@ struct DepsgraphRelationBuilder
|
||||
RootPChanMap *root_map);
|
||||
void build_animdata(ID *id);
|
||||
void build_animdata_curves(ID *id);
|
||||
void build_animdata_curves_targets(ID *id);
|
||||
void build_animdata_curves_targets(ID *id,
|
||||
ComponentKey &adt_key,
|
||||
OperationDepsNode *operation_from,
|
||||
ListBase *curves);
|
||||
void build_animdata_nlastrip_targets(ID *id,
|
||||
ComponentKey &adt_key,
|
||||
OperationDepsNode *operation_from,
|
||||
ListBase *strips);
|
||||
void build_animdata_drivers(ID *id);
|
||||
void build_driver(ID *id, FCurve *fcurve);
|
||||
void build_driver_data(ID *id, FCurve *fcurve);
|
||||
|
@ -443,16 +443,43 @@ void DepsgraphRelationBuilder::build_rig(Object *object)
|
||||
|
||||
void DepsgraphRelationBuilder::build_proxy_rig(Object *object)
|
||||
{
|
||||
OperationKey pose_init_key(&object->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT);
|
||||
OperationKey pose_done_key(&object->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE);
|
||||
Object *proxy_from = object->proxy_from;
|
||||
OperationKey pose_init_key(&object->id,
|
||||
DEG_NODE_TYPE_EVAL_POSE,
|
||||
DEG_OPCODE_POSE_INIT);
|
||||
OperationKey pose_done_key(&object->id,
|
||||
DEG_NODE_TYPE_EVAL_POSE,
|
||||
DEG_OPCODE_POSE_DONE);
|
||||
BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
|
||||
OperationKey bone_local_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL);
|
||||
OperationKey bone_ready_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY);
|
||||
OperationKey bone_done_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE);
|
||||
OperationKey bone_local_key(&object->id,
|
||||
DEG_NODE_TYPE_BONE, pchan->name,
|
||||
DEG_OPCODE_BONE_LOCAL);
|
||||
OperationKey bone_ready_key(&object->id,
|
||||
DEG_NODE_TYPE_BONE,
|
||||
pchan->name,
|
||||
DEG_OPCODE_BONE_READY);
|
||||
OperationKey bone_done_key(&object->id,
|
||||
DEG_NODE_TYPE_BONE,
|
||||
pchan->name,
|
||||
DEG_OPCODE_BONE_DONE);
|
||||
add_relation(pose_init_key, bone_local_key, "Pose Init -> Bone Local");
|
||||
add_relation(bone_local_key, bone_ready_key, "Local -> Ready");
|
||||
add_relation(bone_ready_key, bone_done_key, "Ready -> Done");
|
||||
add_relation(bone_done_key, pose_done_key, "Bone Done -> Pose Done");
|
||||
|
||||
if (pchan->prop != NULL) {
|
||||
OperationKey bone_parameters(&object->id,
|
||||
DEG_NODE_TYPE_PARAMETERS,
|
||||
DEG_OPCODE_PARAMETERS_EVAL,
|
||||
pchan->name);
|
||||
OperationKey from_bone_parameters(&proxy_from->id,
|
||||
DEG_NODE_TYPE_PARAMETERS,
|
||||
DEG_OPCODE_PARAMETERS_EVAL,
|
||||
pchan->name);
|
||||
add_relation(from_bone_parameters,
|
||||
bone_parameters,
|
||||
"Proxy Bone Parameters");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -467,7 +467,7 @@ static void deg_debug_graphviz_node_relations(const DebugContext &ctx,
|
||||
deg_debug_fprintf(ctx, "[");
|
||||
/* Note: without label an id seem necessary to avoid bugs in graphviz/dot */
|
||||
deg_debug_fprintf(ctx, "id=\"%s\"", rel->name);
|
||||
deg_debug_fprintf(ctx, "label=\"%s\"", rel->name);
|
||||
// deg_debug_fprintf(ctx, "label=\"%s\"", rel->name);
|
||||
deg_debug_fprintf(ctx, ",color="); deg_debug_graphviz_relation_color(ctx, rel);
|
||||
deg_debug_fprintf(ctx, ",penwidth=\"%f\"", penwidth);
|
||||
/* NOTE: edge from node to own cluster is not possible and gives graphviz
|
||||
|
@ -476,7 +476,7 @@ void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op, int *winx,
|
||||
|
||||
/* render */
|
||||
void ED_view3d_stop_render_preview(struct wmWindowManager *wm, struct ARegion *ar);
|
||||
void ED_view3d_shade_update(struct Main *bmain, struct Scene *scene, struct View3D *v3d, struct ScrArea *sa);
|
||||
void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrArea *sa);
|
||||
|
||||
#define V3D_IS_ZBUF(v3d) \
|
||||
(((v3d)->flag & V3D_ZBUF_SELECT) && ((v3d)->drawtype > OB_WIRE))
|
||||
|
@ -216,11 +216,6 @@ static bool ED_object_editmode_load_ex(Main *bmain, Object *obedit, const bool f
|
||||
if (freedata) ED_mball_editmball_free(obedit);
|
||||
}
|
||||
|
||||
/* Tag update so no access to freed data referenced from
|
||||
* derived cache will happen.
|
||||
*/
|
||||
DEG_id_tag_update((ID *)obedit->data, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -940,6 +940,9 @@ static void do_weight_paint_vertex(
|
||||
/* Toggle operator for turning vertex paint mode on or off (copied from sculpt.c) */
|
||||
static void vertex_paint_init_session(const EvaluationContext *eval_ctx, Scene *scene, Object *ob)
|
||||
{
|
||||
/* Create persistent sculpt mode data */
|
||||
BKE_sculpt_toolsettings_data_ensure(scene);
|
||||
|
||||
if (ob->sculpt == NULL) {
|
||||
ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
|
||||
BKE_sculpt_update_mesh_elements(eval_ctx, scene, scene->toolsettings->sculpt, ob, 0, false);
|
||||
|
@ -5602,11 +5602,12 @@ static void SCULPT_OT_symmetrize(wmOperatorType *ot)
|
||||
static void sculpt_init_session(const bContext *C, Scene *scene, Object *ob)
|
||||
{
|
||||
EvaluationContext eval_ctx;
|
||||
|
||||
CTX_data_eval_ctx(C, &eval_ctx);
|
||||
|
||||
ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
|
||||
/* Create persistent sculpt mode data */
|
||||
BKE_sculpt_toolsettings_data_ensure(scene);
|
||||
|
||||
ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
|
||||
BKE_sculpt_update_mesh_elements(&eval_ctx, scene, scene->toolsettings->sculpt, ob, 0, false);
|
||||
}
|
||||
|
||||
@ -5614,7 +5615,6 @@ static void sculpt_init_session(const bContext *C, Scene *scene, Object *ob)
|
||||
static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
const int mode_flag = OB_MODE_SCULPT;
|
||||
const bool is_mode_set = (ob->mode & mode_flag) != 0;
|
||||
@ -5670,31 +5670,6 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
|
||||
if (flush_recalc)
|
||||
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
||||
|
||||
/* Create persistent sculpt mode data */
|
||||
if (!ts->sculpt) {
|
||||
ts->sculpt = MEM_callocN(sizeof(Sculpt), "sculpt mode data");
|
||||
|
||||
/* Turn on X plane mirror symmetry by default */
|
||||
ts->sculpt->paint.symmetry_flags |= PAINT_SYMM_X;
|
||||
ts->sculpt->paint.flags |= PAINT_SHOW_BRUSH;
|
||||
|
||||
/* Make sure at least dyntopo subdivision is enabled */
|
||||
ts->sculpt->flags |= SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE;
|
||||
}
|
||||
|
||||
if (!ts->sculpt->detail_size)
|
||||
ts->sculpt->detail_size = 12;
|
||||
if (!ts->sculpt->detail_percent)
|
||||
ts->sculpt->detail_percent = 25;
|
||||
if (ts->sculpt->constant_detail == 0.0f)
|
||||
ts->sculpt->constant_detail = 3.0f;
|
||||
|
||||
/* Set sane default tiling offsets */
|
||||
if (!ts->sculpt->paint.tile_offset[0]) ts->sculpt->paint.tile_offset[0] = 1.0f;
|
||||
if (!ts->sculpt->paint.tile_offset[1]) ts->sculpt->paint.tile_offset[1] = 1.0f;
|
||||
if (!ts->sculpt->paint.tile_offset[2]) ts->sculpt->paint.tile_offset[2] = 1.0f;
|
||||
|
||||
|
||||
/* Create sculpt mode session data */
|
||||
if (ob->sculpt)
|
||||
BKE_sculptsession_free(ob);
|
||||
|
@ -296,7 +296,7 @@ void ED_view3d_stop_render_preview(wmWindowManager *wm, ARegion *ar)
|
||||
}
|
||||
}
|
||||
|
||||
void ED_view3d_shade_update(Main *bmain, Scene *scene, View3D *v3d, ScrArea *sa)
|
||||
void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *sa)
|
||||
{
|
||||
wmWindowManager *wm = bmain->wm.first;
|
||||
|
||||
@ -308,10 +308,6 @@ void ED_view3d_shade_update(Main *bmain, Scene *scene, View3D *v3d, ScrArea *sa)
|
||||
ED_view3d_stop_render_preview(wm, ar);
|
||||
}
|
||||
}
|
||||
else if (scene->obedit != NULL && scene->obedit->type == OB_MESH) {
|
||||
/* Tag mesh to load edit data. */
|
||||
DEG_id_tag_update(scene->obedit->data, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* ******************** default callbacks for view3d space ***************** */
|
||||
|
@ -4696,7 +4696,7 @@ static int toggle_render_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
v3d->prev_drawtype = v3d->drawtype;
|
||||
v3d->drawtype = OB_RENDER;
|
||||
}
|
||||
ED_view3d_shade_update(CTX_data_main(C), CTX_data_scene(C), v3d, CTX_wm_area(C));
|
||||
ED_view3d_shade_update(CTX_data_main(C), v3d, CTX_wm_area(C));
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -573,12 +573,12 @@ static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), Poin
|
||||
DEG_on_visible_update(bmain, false);
|
||||
}
|
||||
|
||||
static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
|
||||
{
|
||||
View3D *v3d = (View3D *)(ptr->data);
|
||||
ScrArea *sa = rna_area_from_space(ptr);
|
||||
|
||||
ED_view3d_shade_update(bmain, scene, v3d, sa);
|
||||
ED_view3d_shade_update(bmain, v3d, sa);
|
||||
}
|
||||
|
||||
static void rna_SpaceView3D_matcap_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
||||
|
@ -1348,7 +1348,7 @@ static const char arg_handle_render_frame_doc[] =
|
||||
"\n"
|
||||
"\t* +<frame> start frame relative, -<frame> end frame relative.\n"
|
||||
"\t* A comma separated list of frames can also be used (no spaces).\n"
|
||||
"\t* A range of frames can be expressed using '..' seperator between the first and last frames (inclusive).\n"
|
||||
"\t* A range of frames can be expressed using '..' separator between the first and last frames (inclusive).\n"
|
||||
;
|
||||
static int arg_handle_render_frame(int argc, const char **argv, void *data)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user