From 27d20a04b54e334784eeb0ec8d440fd6707d9fa3 Mon Sep 17 00:00:00 2001 From: Alexander Romanov Date: Fri, 31 Mar 2017 17:53:55 +0300 Subject: Fix unreported bug in Blender Render: using unnormalized normal in normal map node in the same way as in baking --- source/blender/nodes/shader/nodes/node_shader_normal_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/nodes/shader/nodes/node_shader_normal_map.c b/source/blender/nodes/shader/nodes/node_shader_normal_map.c index 48d1688c386..e0bf34f42e4 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal_map.c +++ b/source/blender/nodes/shader/nodes/node_shader_normal_map.c @@ -63,7 +63,7 @@ static void node_shader_exec_normal_map(void *data, int UNUSED(thread), bNode *n CLAMP_MIN(strength, 0.0f); - float *N = shi->vno; + float *N = shi->nmapnorm; int uv_index = 0; switch (nm->space) { case SHD_NORMAL_MAP_TANGENT: -- cgit v1.2.3 From 90df1142a35dd9b738ef21ceb5f3b12249846482 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 31 Mar 2017 15:29:20 +0200 Subject: Cycles: Solve threading conflict in shader synchronization Update tag might access links (when checking for attributes) and the links might be in the middle of rebuild in simplification logic. --- intern/cycles/blender/blender_shader.cpp | 32 ++++++++++++++++++++++++-------- intern/cycles/blender/blender_sync.h | 1 + 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index 0cd4b90340b..df21e2640bd 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -1158,6 +1158,13 @@ static void add_nodes(Scene *scene, /* Sync Materials */ +void BlenderSync::sync_materials_simpligy(Shader *shader) +{ + ShaderGraph *graph = shader->graph; + graph->simplify(scene); + shader->tag_update(scene); +} + void BlenderSync::sync_materials(bool update_all) { shader_map.set_default(scene->default_surface); @@ -1203,17 +1210,26 @@ void BlenderSync::sync_materials(bool update_all) shader->set_graph(graph); - /* By simplifying the shader graph as soon as possible, some redundant shader nodes - * might be removed which prevents loading unneccessary attributes later. + /* By simplifying the shader graph as soon as possible, some + * redundant shader nodes might be removed which prevents loading + * unnecessary attributes later. * - * However, since graph simplification also accounts for e.g. mix weight, this would - * cause frequent expensive resyncs in interactive sessions, so for those sessions - * optimization is only performed right before compiling. */ + * However, since graph simplification also accounts for e.g. mix + * weight, this would cause frequent expensive resyncs in interactive + * sessions, so for those sessions optimization is only performed + * right before compiling. + */ if(!preview) { - pool.push(function_bind(&ShaderGraph::simplify, shader->graph, scene)); + pool.push(function_bind(&BlenderSync::sync_materials_simpligy, + this, + shader)); + } + else { + /* NOTE: Update tagging can access links which are being + * optimized out. + */ + shader->tag_update(scene); } - - shader->tag_update(scene); } } diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index 36bedc505af..62e2f8f563a 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -96,6 +96,7 @@ public: private: /* sync */ void sync_lamps(bool update_all); + void sync_materials_simpligy(Shader *shader); void sync_materials(bool update_all); void sync_objects(BL::SpaceView3D& b_v3d, float motion_time = 0.0f); void sync_motion(BL::RenderSettings& b_render, -- cgit v1.2.3 From 25ab3aac9d6f1be6e75d6bf9233770a649832384 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 31 Mar 2017 16:09:27 +0200 Subject: Fix threading conflicts in multitex_ext_safe() This function was modifying texture datablock, which makes the call unsafe for call from multiple threads. Now we pass the argument that we don't need nodes to the underlying functions. There will be still race condition in noise texture, but that should at least be free from crashes. Doesn't mean we shouldn't fix it tho. --- .../blender/render/intern/source/render_texture.c | 61 ++++++++++++++-------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index b4a14f5337d..42e4d4f27f6 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -1112,14 +1112,15 @@ static int multitex(Tex *tex, const short which_output, struct ImagePool *pool, const bool skip_load_image, - const bool texnode_preview) + const bool texnode_preview, + const bool use_nodes) { float tmpvec[3]; int retval = 0; /* return value, int:0, col:1, nor:2, everything:3 */ texres->talpha = false; /* is set when image texture returns alpha (considered premul) */ - if (tex->use_nodes && tex->nodetree) { + if (use_nodes && tex->use_nodes && tex->nodetree) { retval = ntreeTexExecTree(tex->nodetree, texres, texvec, dxt, dyt, osatex, thread, tex, which_output, R.r.cfra, texnode_preview, NULL, NULL); } @@ -1239,7 +1240,8 @@ static int multitex_nodes_intern(Tex *tex, ImagePool *pool, const bool scene_color_manage, const bool skip_load_image, - const bool texnode_preview) + const bool texnode_preview, + const bool use_nodes) { if (tex==NULL) { memset(texres, 0, sizeof(TexResult)); @@ -1264,7 +1266,8 @@ static int multitex_nodes_intern(Tex *tex, which_output, pool, skip_load_image, - texnode_preview); + texnode_preview, + use_nodes); if (mtex->mapto & (MAP_COL+MAP_COLSPEC+MAP_COLMIR)) { ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool); @@ -1311,7 +1314,8 @@ static int multitex_nodes_intern(Tex *tex, which_output, pool, skip_load_image, - texnode_preview); + texnode_preview, + use_nodes); { ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool); @@ -1341,7 +1345,8 @@ static int multitex_nodes_intern(Tex *tex, which_output, pool, skip_load_image, - texnode_preview); + texnode_preview, + use_nodes); } } @@ -1354,7 +1359,8 @@ int multitex_nodes(Tex *tex, float texvec[3], float dxt[3], float dyt[3], int os return multitex_nodes_intern(tex, texvec, dxt, dyt, osatex, texres, thread, which_output, shi, mtex, pool, R.scene_color_manage, (R.r.scemode & R_NO_IMAGE_LOAD) != 0, - (R.r.scemode & R_TEXNODE_PREVIEW) != 0); + (R.r.scemode & R_TEXNODE_PREVIEW) != 0, + true); } /* this is called for surface shading */ @@ -1378,7 +1384,8 @@ static int multitex_mtex(ShadeInput *shi, MTex *mtex, float texvec[3], float dxt mtex->which_output, pool, skip_load_image, - (R.r.scemode & R_TEXNODE_PREVIEW) != 0); + (R.r.scemode & R_TEXNODE_PREVIEW) != 0, + true); } } @@ -1408,7 +1415,8 @@ int multitex_ext(Tex *tex, pool, scene_color_manage, skip_load_image, - false); + false, + true); } /* extern-tex doesn't support nodes (ntreeBeginExec() can't be called when rendering is going on)\ @@ -1417,13 +1425,19 @@ int multitex_ext(Tex *tex, */ int multitex_ext_safe(Tex *tex, float texvec[3], TexResult *texres, struct ImagePool *pool, bool scene_color_manage, const bool skip_load_image) { - int use_nodes= tex->use_nodes, retval; - - tex->use_nodes = false; - retval= multitex_nodes_intern(tex, texvec, NULL, NULL, 0, texres, 0, 0, NULL, NULL, pool, scene_color_manage, skip_load_image, false); - tex->use_nodes= use_nodes; - - return retval; + return multitex_nodes_intern(tex, + texvec, + NULL, NULL, + 0, + texres, + 0, + 0, + NULL, NULL, + pool, + scene_color_manage, + skip_load_image, + false, + false); } @@ -2873,7 +2887,8 @@ void do_volume_tex(ShadeInput *shi, const float *xyz, int mapto_flag, float col_ mtex->which_output, re->pool, skip_load_image, - texnode_preview); /* NULL = dxt/dyt, 0 = shi->osatex - not supported */ + texnode_preview, + true); /* NULL = dxt/dyt, 0 = shi->osatex - not supported */ /* texture output */ @@ -3051,7 +3066,8 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4]) mtex->which_output, har->pool, skip_load_image, - texnode_preview); + texnode_preview, + true); /* texture output */ if (rgb && (mtex->texflag & MTEX_RGBTOINT)) { @@ -3274,7 +3290,8 @@ void do_sky_tex( mtex->which_output, R.pool, skip_load_image, - texnode_preview); + texnode_preview, + true); /* texture output */ if (rgb && (mtex->texflag & MTEX_RGBTOINT)) { @@ -3500,7 +3517,8 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r mtex->which_output, R.pool, skip_load_image, - texnode_preview); + texnode_preview, + true); /* texture output */ if (rgb && (mtex->texflag & MTEX_RGBTOINT)) { @@ -3614,7 +3632,8 @@ int externtex(MTex *mtex, mtex->which_output, pool, skip_load_image, - texnode_preview); + texnode_preview, + true); if (rgb) { texr.tin = IMB_colormanagement_get_luminance(&texr.tr); -- cgit v1.2.3 From 6c42079b78743845c67dfc42682c6eed057a2242 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 31 Mar 2017 17:07:44 +0200 Subject: Depsgraph: Correction for the previous local view commit Need to flush layers from components back to ID node. --- source/blender/depsgraph/intern/depsgraph_tag.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index ad73a2db826..cfc9005a1e3 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -349,15 +349,24 @@ void DEG_graph_on_visible_update(Main *bmain, Scene *scene) /* Special trick to get local view to work. */ LINKLIST_FOREACH (Base *, base, &scene->base) { Object *object = base->object; - DEG::IDDepsNode *node = graph->find_id_node(&object->id); - node->layers = 0; + DEG::IDDepsNode *id_node = graph->find_id_node(&object->id); + id_node->layers = 0; } LINKLIST_FOREACH (Base *, base, &scene->base) { Object *object = base->object; - DEG::IDDepsNode *node = graph->find_id_node(&object->id); - node->layers |= base->lay; + DEG::IDDepsNode *id_node = graph->find_id_node(&object->id); + id_node->layers |= base->lay; } DEG::deg_graph_build_flush_layers(graph); + LINKLIST_FOREACH (Base *, base, &scene->base) { + Object *object = base->object; + DEG::IDDepsNode *id_node = graph->find_id_node(&object->id); + GHASH_FOREACH_BEGIN(DEG::ComponentDepsNode *, comp, id_node->components) + { + id_node->layers |= comp->layers; + } + GHASH_FOREACH_END(); + } } void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time)) -- cgit v1.2.3 From e1fb0807437644b2e20d3edac8d4aef92e0f5877 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Apr 2017 12:09:17 +1100 Subject: Cleanup: style --- source/blender/alembic/intern/abc_exporter.cc | 2 +- source/blender/editors/gpencil/gpencil_edit.c | 8 ++++---- source/blender/editors/interface/interface_layout.c | 9 +++++---- source/blender/editors/io/io_collada.c | 2 +- source/blender/editors/transform/transform_snap_object.c | 5 ++--- source/blender/windowmanager/intern/wm_files.c | 2 +- source/blender/windowmanager/intern/wm_window.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc index 61e7712150f..564157fbc97 100644 --- a/source/blender/alembic/intern/abc_exporter.cc +++ b/source/blender/alembic/intern/abc_exporter.cc @@ -418,7 +418,7 @@ void AbcExporter::createTransformWriter(Object *ob, Object *parent, Object *dupl BLI_assert(ob != dupliObParent); /* check if we have already created a transform writer for this object */ - if (getXForm(name) != NULL){ + if (getXForm(name) != NULL) { std::cerr << "xform " << name << " already exists\n"; return; } diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index fa9acc36a2b..601a86b97cb 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -2126,10 +2126,10 @@ static int gp_count_subdivision_cuts(bGPDstroke *gps) int totnewpoints = 0; for (i = 0, pt = gps->points; i < gps->totpoints && pt; i++, pt++) { if (pt->flag & GP_SPOINT_SELECT) { - if (i + 1 < gps->totpoints){ + if (i + 1 < gps->totpoints) { if (gps->points[i + 1].flag & GP_SPOINT_SELECT) { ++totnewpoints; - }; + } } } } @@ -2184,7 +2184,7 @@ static int gp_stroke_subdivide_exec(bContext *C, wmOperator *op) /* if next point is selected add a half way point */ if (pt->flag & GP_SPOINT_SELECT) { - if (i + 1 < oldtotpoints){ + if (i + 1 < oldtotpoints) { if (temp_points[i + 1].flag & GP_SPOINT_SELECT) { pt_final = &gps->points[i2]; /* Interpolate all values */ @@ -2196,7 +2196,7 @@ static int gp_stroke_subdivide_exec(bContext *C, wmOperator *op) pt_final->time = interpf(pt->time, next->time, 0.5f); pt_final->flag |= GP_SPOINT_SELECT; ++i2; - }; + } } } } diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 7b0921941e7..9b6547cf8a1 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -2174,12 +2174,13 @@ static void ui_litem_layout_row(uiLayout *litem) bool min_flag = item->flag & UI_ITEM_MIN; /* ignore min flag for rows with right or center alignment */ if (item->type != ITEM_BUTTON && - ELEM(((uiLayout *)item)->alignment, UI_LAYOUT_ALIGN_RIGHT, UI_LAYOUT_ALIGN_CENTER) && - litem->alignment == UI_LAYOUT_ALIGN_EXPAND && - ((uiItem *)litem)->flag & UI_ITEM_MIN) { + ELEM(((uiLayout *)item)->alignment, UI_LAYOUT_ALIGN_RIGHT, UI_LAYOUT_ALIGN_CENTER) && + litem->alignment == UI_LAYOUT_ALIGN_EXPAND && + ((uiItem *)litem)->flag & UI_ITEM_MIN) + { min_flag = false; } - + if ((neww < minw || min_flag) && w != 0) { /* fixed size */ item->flag |= UI_ITEM_FIXED; diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c index 9b12aa6d475..b8794afbf85 100644 --- a/source/blender/editors/io/io_collada.c +++ b/source/blender/editors/io/io_collada.c @@ -437,7 +437,7 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op) auto_connect, fix_orientation, min_chain_length, - keep_bind_info) ) + keep_bind_info) ) { return OPERATOR_FINISHED; } diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index 3c9becc60dc..b33528b4149 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -1122,15 +1122,14 @@ static bool snapDerivedMesh( float dist_px_sq = dist_squared_to_projected_aabb_simple( lpmat, snapdata->win_half, ray_min_dist, snapdata->mval, ray_org_local, ray_normal_local, bb->vec[0], bb->vec[6]); - if (dist_px_sq > SQUARE(*dist_px)) - { + if (dist_px_sq > SQUARE(*dist_px)) { return retval; } } else { /* was BKE_boundbox_ray_hit_check, see: cf6ca226fa58 */ if (!isect_ray_aabb_v3_simple( - ray_start_local, ray_normal_local, bb->vec[0], bb->vec[6], NULL, NULL)) + ray_start_local, ray_normal_local, bb->vec[0], bb->vec[6], NULL, NULL)) { return retval; } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 6ca742dcfb2..028355f9af3 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -809,7 +809,7 @@ int wm_homefile_read( if (userdef_template == NULL) { /* we need to have preferences load to overwrite preferences from previous template */ userdef_template = BKE_blendfile_userdef_read_from_memory( - datatoc_startup_blend, datatoc_startup_blend_size, NULL); + datatoc_startup_blend, datatoc_startup_blend_size, NULL); } if (userdef_template) { BKE_blender_userdef_set_app_template(userdef_template); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 51f501e0486..aaf77946412 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -397,7 +397,7 @@ static void wm_window_set_dpi(wmWindow *win) /* Blender's UI drawing assumes DPI 72 as a good default following macOS * while Windows and Linux use DPI 96. GHOST assumes a default 96 so we * remap the DPI to Blender's convention. */ - int dpi = auto_dpi * U.ui_scale * (72.0/96.0f); + int dpi = auto_dpi * U.ui_scale * (72.0 / 96.0f); /* Automatically set larger pixel size for high DPI. */ int pixelsize = MAX2(1, dpi / 54); -- cgit v1.2.3 From 3bf0026bec6f839ae0f7c40bde845299ce22e8de Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Sat, 1 Apr 2017 15:29:40 +0200 Subject: fix: T50412 - collada: Replaced precision local limit function by blender's own implementation --- source/blender/collada/collada_utils.cpp | 22 +++++----------------- source/blender/collada/collada_utils.h | 3 +-- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index 407f0799014..ac4395e1430 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -32,9 +32,6 @@ #include "COLLADAFWMeshPrimitive.h" #include "COLLADAFWMeshVertexData.h" -#include "collada_utils.h" -#include "ExportSettings.h" - extern "C" { #include "DNA_modifier_types.h" #include "DNA_customdata_types.h" @@ -64,6 +61,9 @@ extern "C" { #include "bmesh_tools.h" } +#include "collada_utils.h" +#include "ExportSettings.h" + float bc_get_float_value(const COLLADAFW::FloatOrDoubleArray& array, unsigned int index) { if (index >= array.getValuesCount()) @@ -823,24 +823,12 @@ void bc_create_restpose_mat(const ExportSettings *export_settings, Bone *bone, f } -/* - To get rid of those lengthy float values which make the numbers unreadable. -*/ -float bc_sanitize_float(float value, float precision) -{ - float result = floor((value * pow(10, precision) + 0.5)) / pow(10, precision); - if (abs(result) < 1 / pow(10, precision)) { - result = 0; - } - return result; -} - /* Make 4*4 matrices better readable */ -void bc_sanitize_mat(float mat[4][4], float precision) +void bc_sanitize_mat(float mat[4][4], int precision) { for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) - mat[i][j] = bc_sanitize_float(mat[i][j], precision); + mat[i][j] = double_round(mat[i][j], precision); } \ No newline at end of file diff --git a/source/blender/collada/collada_utils.h b/source/blender/collada/collada_utils.h index b98f8bfb188..38c0bd5096a 100644 --- a/source/blender/collada/collada_utils.h +++ b/source/blender/collada/collada_utils.h @@ -97,8 +97,7 @@ extern bool bc_is_leaf_bone(Bone *bone); extern EditBone *bc_get_edit_bone(bArmature * armature, char *name); extern int bc_set_layer(int bitfield, int layer, bool enable); extern int bc_set_layer(int bitfield, int layer); -extern float bc_sanitize_float(float value, float precision); -extern void bc_sanitize_mat(float mat[4][4], float precision); +extern void bc_sanitize_mat(float mat[4][4], int precision); extern IDProperty *bc_get_IDProperty(Bone *bone, std::string key); extern void bc_set_IDProperty(EditBone *ebone, const char *key, float value); -- cgit v1.2.3 From f65d6ea95458ad53715f09165d37f2486e4750be Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Mon, 3 Apr 2017 10:45:24 +0200 Subject: fix: collada - do proper conversion from int to bool (as with other nearby parameters) --- source/blender/collada/collada.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/collada/collada.cpp b/source/blender/collada/collada.cpp index c0784ca8eb5..bf3fcf0c3f0 100644 --- a/source/blender/collada/collada.cpp +++ b/source/blender/collada/collada.cpp @@ -59,7 +59,7 @@ int collada_import(bContext *C, import_settings.find_chains = find_chains != 0; import_settings.fix_orientation = fix_orientation != 0; import_settings.min_chain_length = min_chain_length; - import_settings.keep_bind_info = keep_bind_info; + import_settings.keep_bind_info = keep_bind_info !=0; DocumentImporter imp(C, &import_settings); if (imp.import()) return 1; -- cgit v1.2.3 From 368b74315a58f66187b924cbc646abd05ce6a2b7 Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Mon, 3 Apr 2017 10:48:00 +0200 Subject: Collada - add flag to limit precision of exported data, mainly to simplify debugging --- source/blender/collada/ArmatureExporter.cpp | 4 +++- source/blender/collada/ControllerExporter.cpp | 3 ++- source/blender/collada/ExportSettings.h | 1 + source/blender/collada/collada.cpp | 6 +++--- source/blender/collada/collada.h | 1 + source/blender/editors/io/io_collada.c | 10 ++++++++++ source/blender/makesrna/intern/rna_scene_api.c | 9 ++++++++- 7 files changed, 28 insertions(+), 6 deletions(-) diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp index 49722873a91..9348f3b3285 100644 --- a/source/blender/collada/ArmatureExporter.cpp +++ b/source/blender/collada/ArmatureExporter.cpp @@ -304,7 +304,9 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW: } } - bc_sanitize_mat(mat, 6); // XXX: Make this optional ? + if (this->export_settings->limit_precision) + bc_sanitize_mat(mat, 6); + TransformWriter::add_node_transform(node, mat, NULL); } diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp index 5444c9dfa6b..1c2642e8313 100644 --- a/source/blender/collada/ControllerExporter.cpp +++ b/source/blender/collada/ControllerExporter.cpp @@ -533,7 +533,8 @@ std::string ControllerExporter::add_inv_bind_mats_source(Object *ob_arm, ListBas invert_m4_m4(mat, world); converter.mat4_to_dae(inv_bind_mat, mat); - bc_sanitize_mat(inv_bind_mat, 6); // XXX: Make this optional ? + if (this->export_settings->limit_precision) + bc_sanitize_mat(inv_bind_mat, 6); source.appendValues(inv_bind_mat); } } diff --git a/source/blender/collada/ExportSettings.h b/source/blender/collada/ExportSettings.h index 03e380dc198..de91f68a492 100644 --- a/source/blender/collada/ExportSettings.h +++ b/source/blender/collada/ExportSettings.h @@ -53,6 +53,7 @@ public: BC_export_transformation_type export_transformation_type; bool open_sim; + bool limit_precision; bool keep_bind_info; char *filepath; diff --git a/source/blender/collada/collada.cpp b/source/blender/collada/collada.cpp index bf3fcf0c3f0..bfe3180909b 100644 --- a/source/blender/collada/collada.cpp +++ b/source/blender/collada/collada.cpp @@ -90,7 +90,7 @@ int collada_export(Scene *sce, int sort_by_name, BC_export_transformation_type export_transformation_type, int open_sim, - + int limit_precision, int keep_bind_info) { ExportSettings export_settings; @@ -116,8 +116,8 @@ int collada_export(Scene *sce, export_settings.sort_by_name = sort_by_name != 0; export_settings.export_transformation_type = export_transformation_type; export_settings.open_sim = open_sim != 0; - - export_settings.keep_bind_info = keep_bind_info; + export_settings.limit_precision = limit_precision != 0; + export_settings.keep_bind_info = keep_bind_info !=0; int includeFilter = OB_REL_NONE; if (export_settings.include_armatures) includeFilter |= OB_REL_MOD_ARMATURE; diff --git a/source/blender/collada/collada.h b/source/blender/collada/collada.h index 09acc4a064b..8035af59c8b 100644 --- a/source/blender/collada/collada.h +++ b/source/blender/collada/collada.h @@ -85,6 +85,7 @@ int collada_export(struct Scene *sce, BC_export_transformation_type export_transformation_type, int open_sim, + int limit_precision, int keep_bind_info); #ifdef __cplusplus diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c index b8794afbf85..139c9817437 100644 --- a/source/blender/editors/io/io_collada.c +++ b/source/blender/editors/io/io_collada.c @@ -99,6 +99,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op) int export_transformation_type; int open_sim; + int limit_precision; int keep_bind_info; int export_count; @@ -150,6 +151,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op) export_transformation_type = RNA_enum_get(op->ptr, "export_transformation_type_selection"); open_sim = RNA_boolean_get(op->ptr, "open_sim"); + limit_precision = RNA_boolean_get(op->ptr, "limit_precision"); keep_bind_info = RNA_boolean_get(op->ptr, "keep_bind_info"); /* get editmode results */ @@ -178,6 +180,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op) export_transformation_type, open_sim, + limit_precision, keep_bind_info ); @@ -276,9 +279,13 @@ static void uiCollada_exportSettings(uiLayout *layout, PointerRNA *imfptr) row = uiLayoutRow(box, false); uiItemR(row, imfptr, "sort_by_name", 0, NULL, ICON_NONE); + row = uiLayoutRow(box, false); uiItemR(row, imfptr, "keep_bind_info", 0, NULL, ICON_NONE); + row = uiLayoutRow(box, false); + uiItemR(row, imfptr, "limit_precision", 0, NULL, ICON_NONE); + } static void wm_collada_export_draw(bContext *UNUSED(C), wmOperator *op) @@ -396,6 +403,9 @@ void WM_OT_collada_export(wmOperatorType *ot) RNA_def_boolean(func, "open_sim", 0, "Export to SL/OpenSim", "Compatibility mode for SL, OpenSim and other compatible online worlds"); + RNA_def_boolean(func, "limit_precision", 0, + "Limit Precision", "Reduce the precision of the exported data to 6 digits"); + RNA_def_boolean(func, "keep_bind_info", 0, "Keep Bind Info", "Store Bindpose information in custom bone properties for later use during Collada export"); diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index f3146c9e6a8..9b202120b82 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -285,6 +285,7 @@ static void rna_Scene_collada_export( int sort_by_name, int export_transformation_type, int open_sim, + int limit_precision, int keep_bind_info) { collada_export(scene, @@ -311,6 +312,7 @@ static void rna_Scene_collada_export( export_transformation_type, open_sim, + limit_precision, keep_bind_info); } @@ -422,7 +424,12 @@ void RNA_api_scene(StructRNA *srna) RNA_def_boolean(func, "open_sim", false, "Export to SL/OpenSim", "Compatibility mode for SL, OpenSim and other compatible online worlds"); - RNA_def_boolean(func, "keep_bind_info", false, "Keep Bind Info", + RNA_def_boolean(func, "limit_precision", false, + "Limit Precision", + "Reduce the precision of the exported data to 6 digits"); + + RNA_def_boolean(func, "keep_bind_info", false, + "Keep Bind Info", "Store bind pose information in custom bone properties for later use during Collada export"); #endif -- cgit v1.2.3 From ab347c83801cc5b824ecf21d9aae9d8a0f356bc9 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 3 Apr 2017 10:50:42 +0200 Subject: Fix T51115: Bump node is broken when the displacement socket is used --- intern/cycles/render/graph.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp index 0362e8f834a..12fff8e5587 100644 --- a/intern/cycles/render/graph.cpp +++ b/intern/cycles/render/graph.cpp @@ -238,6 +238,8 @@ ShaderGraph *ShaderGraph::copy() foreach(ShaderNode *node, nodes) newgraph->add(nodes_copy[node]); + newgraph->simplified = simplified; + return newgraph; } @@ -245,7 +247,6 @@ void ShaderGraph::connect(ShaderOutput *from, ShaderInput *to) { assert(!finalized); assert(from && to); - simplified = false; if(to->link) { fprintf(stderr, "Cycles shader graph connect: input already connected.\n"); -- cgit v1.2.3 From 54a60eff24a73660e1bb1ab488bbc93e528e11e6 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 3 Apr 2017 12:31:33 +0200 Subject: Fix blender player --- source/blenderplayer/bad_level_call_stubs/stubs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index d659f5c1a8a..daaeacea77b 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -738,6 +738,7 @@ int collada_export(struct Scene *sce, int sort_by_name, BC_export_transformation_type export_transformation_type, int open_sim, + int limit_precision, int keep_bind_info) RET_ZERO void ED_mesh_calc_tessface(struct Mesh *mesh, bool free_mpoly) RET_NONE -- cgit v1.2.3 From d27ef3913a823e571427c8fab23e5ad356cefab3 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 3 Apr 2017 14:49:07 +0200 Subject: Buildbot: Some special tricks for Blender 2.8 slave --- build_files/buildbot/master_unpack.py | 3 +++ build_files/buildbot/slave_pack.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build_files/buildbot/master_unpack.py b/build_files/buildbot/master_unpack.py index ec44705931c..67b628f668a 100644 --- a/build_files/buildbot/master_unpack.py +++ b/build_files/buildbot/master_unpack.py @@ -67,6 +67,9 @@ def get_platform(filename): def get_branch(filename): + if filename.startswith("blender-2.8"): + return "blender2.8" + tokens = filename.split("-") branch = "" diff --git a/build_files/buildbot/slave_pack.py b/build_files/buildbot/slave_pack.py index 490f0456045..33bf3745182 100644 --- a/build_files/buildbot/slave_pack.py +++ b/build_files/buildbot/slave_pack.py @@ -111,7 +111,8 @@ if builder.find('cmake') != -1: if builder.endswith('vc2015'): platform += "-vc14" builderified_name = 'blender-{}-{}-{}'.format(blender_full_version, git_hash, platform) - if branch != '': + # NOTE: Blender 2.8 is already respected by blender_full_version. + if branch != '' and branch != 'blender2.8': builderified_name = branch + "-" + builderified_name os.rename(result_file, "{}.zip".format(builderified_name)) -- cgit v1.2.3 From 2aa0215ec53e7dc5ee4117627cb525c5228de7ad Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 3 Apr 2017 14:54:51 +0200 Subject: Point all submodules to master branch This way it should be safe to use `git submodule update --remote`. --- .gitmodules | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitmodules b/.gitmodules index 0b8228e3f14..2f52bfce372 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,15 +2,19 @@ path = release/scripts/addons url = ../blender-addons.git ignore = all + branch = master [submodule "release/scripts/addons_contrib"] path = release/scripts/addons_contrib url = ../blender-addons-contrib.git ignore = all + branch = master [submodule "release/datafiles/locale"] path = release/datafiles/locale url = ../blender-translations.git ignore = all + branch = master [submodule "source/tools"] path = source/tools url = ../blender-dev-tools.git ignore = all + branch = master -- cgit v1.2.3 From cc93a66e71a9de09cb41d4433be86e0f056d2b6f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 3 Apr 2017 15:04:16 +0200 Subject: Buildbot: SPecial branch trickery for linux slaves --- build_files/buildbot/slave_pack.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build_files/buildbot/slave_pack.py b/build_files/buildbot/slave_pack.py index 33bf3745182..6929be85003 100644 --- a/build_files/buildbot/slave_pack.py +++ b/build_files/buildbot/slave_pack.py @@ -178,7 +178,8 @@ if builder.find('cmake') != -1: blender_hash, blender_glibc, blender_arch) - if branch != '': + # NOTE: Blender 2.8 is already respected by blender_full_version. + if branch != '' and branch != 'blender2.8': package_name = branch + "-" + package_name upload_filename = package_name + ".tar.bz2" -- cgit v1.2.3