[Bf-blender-cvs] [fb5e3fe0508] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Commit: fb5e3fe0508b531c37abaa587cab6035aeea3afa Author: Antonio Vazquez Date: Fri May 18 09:54:23 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBfb5e3fe0508b531c37abaa587cab6035aeea3afa Merge branch 'blender2.8' into greasepencil-object === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [630f4a07d20] greasepencil-object: Replace CFRA with Depsgraph time to fix animation
Commit: 630f4a07d204b127ccdb515710489a7bedebc79b Author: Antonio Vazquez Date: Fri May 18 10:38:43 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB630f4a07d204b127ccdb515710489a7bedebc79b Replace CFRA with Depsgraph time to fix animation The animation was not working because the number of current frame was not evaluated from depsgraph. === M source/blender/draw/engines/gpencil/gpencil_draw_utils.c === diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index aa0bc93e534..9e2b60d0619 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -47,6 +47,7 @@ /* For EvaluationContext... */ #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "IMB_imbuf_types.h" @@ -1082,13 +1083,15 @@ void DRW_gpencil_populate_multiedit(GPENCIL_e_data *e_data, void *vedata, Scene bGPDframe *gpf = NULL; GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; - GpencilBatchCache *cache = gpencil_batch_cache_get(ob, CFRA); + const DRWContextState *draw_ctx = DRW_context_state_get(); + int cfra_eval = (int)DEG_get_ctime(draw_ctx->depsgraph); + GpencilBatchCache *cache = gpencil_batch_cache_get(ob, cfra_eval); ToolSettings *ts = scene->toolsettings; cache->cache_idx = 0; /* check if playing animation */ bool playing = (bool)stl->storage->playing; - + /* draw strokes */ for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { /* don't draw layer if hidden */ @@ -1105,7 +1108,7 @@ void DRW_gpencil_populate_multiedit(GPENCIL_e_data *e_data, void *vedata, Scene } } else { - gpf = BKE_gpencil_layer_getframe(gpl, CFRA, 0); + gpf = BKE_gpencil_layer_getframe(gpl, cfra_eval, 0); if (gpf) { gpencil_draw_strokes(cache, e_data, vedata, ts, ob, gpd, gpl, gpf, gpf, gpl->opacity, gpl->tintcolor, false); @@ -1121,6 +1124,8 @@ void DRW_gpencil_populate_multiedit(GPENCIL_e_data *e_data, void *vedata, Scene void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene *scene, Object *ob, bGPdata *gpd) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; + const DRWContextState *draw_ctx = DRW_context_state_get(); + int cfra_eval = (int)DEG_get_ctime(draw_ctx->depsgraph); ToolSettings *ts = scene->toolsettings; bGPDframe *derived_gpf = NULL; bool no_onion = (bool)(gpd->flag & GP_DATA_STROKE_WEIGHTMODE); @@ -1128,7 +1133,7 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene /* check if playing animation */ bool playing = (bool)stl->storage->playing; - GpencilBatchCache *cache = gpencil_batch_cache_get(ob, CFRA); + GpencilBatchCache *cache = gpencil_batch_cache_get(ob, cfra_eval); cache->cache_idx = 0; /* init general modifiers data */ @@ -1143,7 +1148,7 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene if (gpl->flag & GP_LAYER_HIDE) continue; - bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, CFRA, 0); + bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, cfra_eval, 0); if (gpf == NULL) continue; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3ba96b7c4da] hair_guides: Add a hair system to particles to eventually replace the current pathcaches.
Commit: 3ba96b7c4da8aa3461db5985b8d5c762695d49e2 Author: Lukas Tönne Date: Thu May 17 09:36:12 2018 +0100 Branches: hair_guides https://developer.blender.org/rB3ba96b7c4da8aa3461db5985b8d5c762695d49e2 Add a hair system to particles to eventually replace the current pathcaches. === M source/blender/blenkernel/BKE_hair.h M source/blender/blenkernel/intern/hair.c M source/blender/blenkernel/intern/object.c M source/blender/blenkernel/intern/particle.c M source/blender/blenkernel/intern/particle_system.c M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/writefile.c M source/blender/makesdna/DNA_particle_types.h === diff --git a/source/blender/blenkernel/BKE_hair.h b/source/blender/blenkernel/BKE_hair.h index 08a28593712..34eb9d2df3a 100644 --- a/source/blender/blenkernel/BKE_hair.h +++ b/source/blender/blenkernel/BKE_hair.h @@ -81,6 +81,10 @@ void BKE_hair_set_guide_vertex(struct HairSystem *hsys, int index, int flag, con */ void BKE_hair_set_hair_guides(struct HairSystem *hsys, struct HairGuideData *guides); +/* Remove all guide curves. + */ +void BKE_hair_clear_guides(struct HairSystem *hsys); + /* === Follicles === */ /* Calculate surface area of a scalp mesh */ diff --git a/source/blender/blenkernel/intern/hair.c b/source/blender/blenkernel/intern/hair.c index d6291dfa71f..2b0d95f83ad 100644 --- a/source/blender/blenkernel/intern/hair.c +++ b/source/blender/blenkernel/intern/hair.c @@ -285,13 +285,35 @@ void BKE_hair_set_hair_guides(HairSystem *hsys, HairGuideData *guides) hsys->guides.verts = MEM_dupallocN(hsys->guides.verts); hsys->guides.totverts = guides->totverts; +#ifndef NDEBUG const int vertcount = hair_guide_calc_vertstart(hsys); BLI_assert(vertcount <= hsys->guides.totverts); +#endif hsys->flag |= HAIR_SYSTEM_UPDATE_FOLLICLE_BINDING; BKE_hair_batch_cache_dirty(hsys, BKE_HAIR_BATCH_DIRTY_ALL); } +void BKE_hair_clear_guides(HairSystem *hsys) +{ + if (hsys->guides.curves) + { + MEM_freeN(hsys->guides.curves); + hsys->guides.curves = NULL; + } + hsys->guides.totcurves = 0; + + if (hsys->guides.verts) + { + MEM_freeN(hsys->guides.verts); + hsys->guides.verts = NULL; + } + hsys->guides.totverts = 0; + + hsys->flag &= ~HAIR_SYSTEM_UPDATE_FOLLICLE_BINDING; + BKE_hair_batch_cache_dirty(hsys, BKE_HAIR_BATCH_DIRTY_ALL); +} + /* = */ BLI_INLINE void hair_fiber_verify_weights(HairFollicle *follicle) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 3e4b646bcbb..63c7524ff2b 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -75,6 +75,7 @@ #include "BKE_main.h" #include "BKE_global.h" #include "BKE_groom.h" +#include "BKE_hair.h" #include "BKE_idprop.h" #include "BKE_armature.h" #include "BKE_action.h" @@ -867,6 +868,10 @@ ParticleSystem *BKE_object_copy_particlesystem(ParticleSystem *psys, const int f for (p = 0, pa = psysn->particles; p < psysn->totpart; p++, pa++) pa->hair = MEM_dupallocN(pa->hair); } + if (psys->hair_system) + { + psys->hair_system = BKE_hair_copy(psys->hair_system); + } if (psysn->particles && (psysn->particles->keys || psysn->particles->boid)) { ParticleKey *key = psysn->particles->keys; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index c8e96285923..874fe56f613 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -68,6 +68,7 @@ #include "BKE_effect.h" #include "BKE_global.h" #include "BKE_group.h" +#include "BKE_hair.h" #include "BKE_main.h" #include "BKE_lattice.h" @@ -440,6 +441,11 @@ void free_hair(Object *UNUSED(ob), ParticleSystem *psys, int dynamics) pa->hair = NULL; pa->totkey = 0; } + if (psys->hair_system) + { + BKE_hair_free(psys->hair_system); + } + psys->hair_system = NULL; psys->flag &= ~PSYS_HAIR_DONE; @@ -539,6 +545,11 @@ void psys_free_particles(ParticleSystem *psys) psys->particles = NULL; psys->totpart = 0; } + + if (psys->hair_system) + { + BKE_hair_clear_guides(psys->hair_system); + } } void psys_free_pdd(ParticleSystem *psys) { @@ -2567,6 +2578,8 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra, const bool use_re psys->totcached = totpart; + // TODO update hair export cache + if (psys->lattice
[Bf-blender-cvs] [278e3f7d5fe] master: Logging: add --show-log-backtrace
Commit: 278e3f7d5fea2a8b3775e76257dfd96a5e5c2f11 Author: Campbell Barton Date: Fri May 18 11:00:47 2018 +0200 Branches: master https://developer.blender.org/rB278e3f7d5fea2a8b3775e76257dfd96a5e5c2f11 Logging: add --show-log-backtrace Useful in debug builds to see a functions callers. === M intern/clog/CLG_log.h M intern/clog/clog.c M source/creator/creator_args.c === diff --git a/intern/clog/CLG_log.h b/intern/clog/CLG_log.h index ff8f983b10c..61fc93be9e7 100644 --- a/intern/clog/CLG_log.h +++ b/intern/clog/CLG_log.h @@ -146,6 +146,7 @@ void CLG_exit(void); void CLG_output_set(void *file_handle); void CLG_output_use_basename_set(int value); void CLG_fatal_fn_set(void (*fatal_fn)(void *file_handle)); +void CLG_backtrace_fn_set(void (*fatal_fn)(void *file_handle)); void CLG_type_filter_include(const char *type_filter, int type_filter_len); void CLG_type_filter_exclude(const char *type_filter, int type_filter_len); diff --git a/intern/clog/clog.c b/intern/clog/clog.c index e93ba9ec2b7..2e5201d63b0 100644 --- a/intern/clog/clog.c +++ b/intern/clog/clog.c @@ -81,6 +81,7 @@ typedef struct CLogContext { struct { void (*fatal_fn)(void *file_handle); + void (*backtrace_fn)(void *file_handle); } callbacks; } CLogContext; @@ -328,15 +329,23 @@ static CLG_LogType *clg_ctx_type_register(CLogContext *ctx, const char *identifi return ty; } -static void clg_ctx_fatal_action(CLogContext *ctx, FILE *file_handle) +static void clg_ctx_fatal_action(CLogContext *ctx) { if (ctx->callbacks.fatal_fn != NULL) { - ctx->callbacks.fatal_fn(file_handle); + ctx->callbacks.fatal_fn(ctx->output_file); } - fflush(file_handle); + fflush(ctx->output_file); abort(); } +static void clg_ctx_backtrace(CLogContext *ctx) +{ + /* Note: we avoid writing fo 'FILE', for backtrace we make an exception, +* if necessary we could have a version of the callback that writes to file descriptor all at once. */ + ctx->callbacks.backtrace_fn(ctx->output_file); + fflush(ctx->output_file); +} + /** \} */ /* */ @@ -408,8 +417,12 @@ void CLG_log_str( clg_str_free(&cstr); + if (lg->ctx->callbacks.backtrace_fn) { + clg_ctx_backtrace(lg->ctx); + } + if (severity == CLG_SEVERITY_FATAL) { - clg_ctx_fatal_action(lg->ctx, lg->ctx->output_file); + clg_ctx_fatal_action(lg->ctx); } } @@ -439,8 +452,12 @@ void CLG_logf( clg_str_free(&cstr); + if (lg->ctx->callbacks.backtrace_fn) { + clg_ctx_backtrace(lg->ctx); + } + if (severity == CLG_SEVERITY_FATAL) { - clg_ctx_fatal_action(lg->ctx, lg->ctx->output_file); + clg_ctx_fatal_action(lg->ctx); } } @@ -470,6 +487,11 @@ static void CLG_ctx_fatal_fn_set(CLogContext *ctx, void (*fatal_fn)(void *file_h ctx->callbacks.fatal_fn = fatal_fn; } +static void CLG_ctx_backtrace_fn_set(CLogContext *ctx, void (*backtrace_fn)(void *file_handle)) +{ + ctx->callbacks.backtrace_fn = backtrace_fn; +} + static void clg_ctx_type_filter_append(CLG_IDFilter **flt_list, const char *type_match, int type_match_len) { if (type_match_len == 0) { @@ -567,6 +589,11 @@ void CLG_fatal_fn_set(void (*fatal_fn)(void *file_handle)) CLG_ctx_fatal_fn_set(g_ctx, fatal_fn); } +void CLG_backtrace_fn_set(void (*fatal_fn)(void *file_handle)) +{ + CLG_ctx_backtrace_fn_set(g_ctx, fatal_fn); +} + void CLG_type_filter_exclude(const char *type_match, int type_match_len) { CLG_ctx_type_filter_exclude(g_ctx, type_match, type_match_len); diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index 675f2621942..4b5038d89df 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -536,6 +536,7 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo BLI_argsPrintArgDoc(ba, "--log"); BLI_argsPrintArgDoc(ba, "--log-level"); BLI_argsPrintArgDoc(ba, "--log-show-basename"); + BLI_argsPrintArgDoc(ba, "--log-show-backtrace"); BLI_argsPrintArgDoc(ba, "--log-file"); printf("\n"); @@ -748,6 +749,17 @@ static int arg_handle_log_show_basename_set(int UNUSED(argc), const char **UNUSE return 0; } +static const char arg_handle_log_show_backtrace_set_doc[] = +"\n\tShow a back trace for each log message (debug builds only)." +; +static int arg_handle_log_show_backtrace_set(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) +{ + /* Ensure types don't become incompatible. */ + void (*fn)(FILE *fp) = BLI_system_backtrace; + CLG_back
[Bf-blender-cvs] [987d1df5715] blender2.8: Tool System: store the active tool in ScrArea
Commit: 987d1df57159afd57f33d7e58681be2fcdebda16 Author: Campbell Barton Date: Fri May 18 09:35:10 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB987d1df57159afd57f33d7e58681be2fcdebda16 Tool System: store the active tool in ScrArea Without this we need to have the context to get the (space_type, mode) args for an active tool lookup. For event handling & poll its more convenient to have direct access. === M source/blender/blenloader/intern/readfile.c M source/blender/editors/mesh/editmesh_extrude.c M source/blender/editors/screen/area.c M source/blender/editors/transform/transform_manipulator_3d.c M source/blender/makesdna/DNA_screen_types.h M source/blender/windowmanager/WM_api.h M source/blender/windowmanager/intern/wm_event_system.c M source/blender/windowmanager/intern/wm_toolsystem.c === diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3d1707f2e77..85c67047be0 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6603,6 +6603,8 @@ static void lib_link_area(FileData *fd, ID *parent_id, ScrArea *area) { area->full = newlibadr(fd, parent_id->lib, area->full); + memset(&area->runtime, 0x0, sizeof(area->runtime)); + for (SpaceLink *sl = area->spacedata.first; sl; sl= sl->next) { switch (sl->spacetype) { case SPACE_VIEW3D: diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c index 95bf8e89b0e..4841de3c856 100644 --- a/source/blender/editors/mesh/editmesh_extrude.c +++ b/source/blender/editors/mesh/editmesh_extrude.c @@ -419,9 +419,8 @@ static void manipulator_mesh_extrude_orientation_matrix_set( static bool manipulator_mesh_extrude_poll(const bContext *C, wmManipulatorGroupType *wgt) { - WorkSpace *workspace = CTX_wm_workspace(C); - const bToolKey tkey = { .space_type = SPACE_VIEW3D, .mode = CTX_MODE_EDIT_MESH, }; - bToolRef_Runtime *tref_rt = WM_toolsystem_runtime_find(workspace, &tkey); + ScrArea *sa = CTX_wm_area(C); + bToolRef_Runtime *tref_rt = sa->runtime.tool ? sa->runtime.tool->runtime : NULL; if ((tref_rt == NULL) || !STREQ(wgt->idname, tref_rt->manipulator_group) || !ED_operator_editmesh_view3d((bContext *)C)) diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 24d6b7c6ecf..4c5ba38984b 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1393,7 +1393,10 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar /* called in screen_refresh, or screens_init, also area size changes */ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa) { - const bScreen *screen = WM_window_get_active_screen(win); + WorkSpace *workspace = WM_window_get_active_workspace(win); + const bScreen *screen = BKE_workspace_active_screen_get(win->workspace_hook); + Scene *scene = WM_window_get_active_scene(win); + const int window_size_x = WM_window_pixels_x(win); const int window_size_y = WM_window_pixels_y(win); ARegion *ar; @@ -1452,6 +1455,8 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa) /* Some AZones use View2D data which is only updated in region init, so call that first! */ region_azones_add(screen, sa, ar, ar->alignment & ~RGN_SPLIT_PREV); } + + WM_toolsystem_refresh_screen_area(workspace, scene, sa); } static void region_update_rect(ARegion *ar) diff --git a/source/blender/editors/transform/transform_manipulator_3d.c b/source/blender/editors/transform/transform_manipulator_3d.c index c24291953c8..8b635bb26db 100644 --- a/source/blender/editors/transform/transform_manipulator_3d.c +++ b/source/blender/editors/transform/transform_manipulator_3d.c @@ -1282,15 +1282,9 @@ static void WIDGETGROUP_manipulator_setup(const bContext *C, wmManipulatorGroup { /* TODO: support mixing modes again? - it's supported but tool system makes it unobvious. */ man->twtype = 0; - WorkSpace *workspace = CTX_wm_workspace(C); - Scene *scene = CTX_data_scene(C); ScrArea *sa = CTX_wm_area(C); - const bToolKey tkey = { - .space_type = sa->spacetype, - .mode = WM_toolsystem_mode_from_spacetype(workspace, scene, NULL, sa->spacetype), - }; - bToolRef_Runtime *tref_rt = WM_toolsystem_runtime_find(workspace, &tkey); - wmKeyMap *km = WM_keymap_find_all(C, tref_rt->keymap, sa->spacetype, RGN_TYPE_WIN
[Bf-blender-cvs] [2451a1951e2] blender2.8: Merge branch 'master' into blender2.8
Commit: 2451a1951e22fd7761f7e39ededda0bd5cc2d875 Author: Campbell Barton Date: Fri May 18 11:02:39 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB2451a1951e22fd7761f7e39ededda0bd5cc2d875 Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1cf0930e895] blender2.8: Fix manipulator resetting the cursor
Commit: 1cf0930e895b38d2e6991c9f62fa44fa9c1cc326 Author: Campbell Barton Date: Fri May 18 11:42:37 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB1cf0930e895b38d2e6991c9f62fa44fa9c1cc326 Fix manipulator resetting the cursor === M source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c === diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c index 1bb479774c2..da55db9db00 100644 --- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c +++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c @@ -865,13 +865,14 @@ void wm_manipulatormap_highlight_set( if (C && mpr->type->cursor_get) { wmWindow *win = CTX_wm_window(C); + win->lastcursor = win->cursor; WM_cursor_set(win, mpr->type->cursor_get(mpr)); } } else { if (C) { wmWindow *win = CTX_wm_window(C); - WM_cursor_set(win, CURSOR_STD); + WM_cursor_set(win, win->lastcursor); } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6e40b2de7ae] blender2.8: Fix operator execution resetting the cursor
Commit: 6e40b2de7ae81653f4005fbcd159aae2687f6e8d Author: Campbell Barton Date: Fri May 18 11:42:58 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB6e40b2de7ae81653f4005fbcd159aae2687f6e8d Fix operator execution resetting the cursor Area and region are NULL in the context if the operator finishes. === M source/blender/windowmanager/intern/wm_event_system.c === diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index ad10475906d..74de77ee1c2 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1958,7 +1958,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand /* set cursor back to the default for the region */ wmWindow *win = CTX_wm_window(C); WM_cursor_grab_disable(win, NULL); - ED_region_cursor_set(win, CTX_wm_area(C), CTX_wm_region(C)); + ED_region_cursor_set(win, area, region); BLI_remlink(handlers, handler); wm_event_free_handler(handler); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [17852b079c9] blender2.8: Tool System: support for tool cursors
Commit: 17852b079c9d2d67e474112aa79a3e8a674b05d2 Author: Campbell Barton Date: Fri May 18 11:44:28 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB17852b079c9d2d67e474112aa79a3e8a674b05d2 Tool System: support for tool cursors === M source/blender/editors/screen/area.c M source/blender/editors/space_view3d/space_view3d.c M source/blender/windowmanager/WM_api.h M source/blender/windowmanager/intern/wm_cursors.c === diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 4c5ba38984b..b2245886991 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1491,6 +1491,9 @@ void ED_region_cursor_set(wmWindow *win, ScrArea *sa, ARegion *ar) ar->type->cursor(win, sa, ar); } else { + if (WM_cursor_set_from_tool(win, sa, ar)) { + return; + } WM_cursor_set(win, CURSOR_STD); } } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index de2ef45247b..df9d8dad6ee 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1104,8 +1104,12 @@ static void view3d_main_region_message_subscribe( } /* concept is to retrieve cursor type context-less */ -static void view3d_main_region_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *UNUSED(ar)) +static void view3d_main_region_cursor(wmWindow *win, ScrArea *sa, ARegion *ar) { + if (WM_cursor_set_from_tool(win, sa, ar)) { + return; + } + ViewLayer *view_layer = WM_window_get_active_view_layer(win); Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); if (obedit) { diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index afa6e71e610..0d48cd9ef20 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -157,6 +157,7 @@ voidWM_lib_reload(struct Library *lib, struct bContext *C, struct Report /* mouse cursors */ void WM_cursor_set(struct wmWindow *win, int curs); +bool WM_cursor_set_from_tool(struct wmWindow *win, const ScrArea *sa, const ARegion *ar); void WM_cursor_modal_set(struct wmWindow *win, int curs); void WM_cursor_modal_restore(struct wmWindow *win); void WM_cursor_wait (bool val); diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index ad5e83ceda7..d5f67d81f18 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -42,6 +42,7 @@ #include "DNA_listBase.h" #include "DNA_userdef_types.h" +#include "DNA_workspace_types.h" #include "BKE_context.h" #include "BKE_global.h" @@ -156,6 +157,23 @@ void WM_cursor_set(wmWindow *win, int curs) } } +bool WM_cursor_set_from_tool(struct wmWindow *win, const ScrArea *sa, const ARegion *ar) +{ + if (ar && (ar->regiontype != RGN_TYPE_WINDOW)) { + return false; + } + + bToolRef_Runtime *tref_rt = (sa && sa->runtime.tool) ? sa->runtime.tool->runtime : NULL; + if (tref_rt && tref_rt->cursor != CURSOR_STD) { + if (win->modalcursor == 0) { + WM_cursor_set(win, tref_rt->cursor); + win->cursor = tref_rt->cursor; + return true; + } + } + return false; +} + void WM_cursor_modal_set(wmWindow *win, int val) { if (win->lastcursor == 0) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b6a2dbbec20] blender2.8: Tool System: set cursors for draw & transform
Commit: b6a2dbbec20dca1010596aeb321b8295876d37ed Author: Campbell Barton Date: Fri May 18 11:57:40 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBb6a2dbbec20dca1010596aeb321b8295876d37ed Tool System: set cursors for draw & transform === M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py === diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 4a368bd712d..137ca779065 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -109,6 +109,7 @@ class _defs_transform: def translate(): return dict( text="Move", +cursor='SCROLL_XY', icon="ops.transform.translate", widget="TRANSFORM_WGT_manipulator", keymap=( @@ -120,6 +121,7 @@ class _defs_transform: def rotate(): return dict( text="Rotate", +cursor='SCROLL_XY', icon="ops.transform.rotate", widget="TRANSFORM_WGT_manipulator", keymap=( @@ -131,6 +133,7 @@ class _defs_transform: def scale(): return dict( text="Scale", +cursor='SCROLL_XY', icon="ops.transform.resize", widget="TRANSFORM_WGT_manipulator", keymap=( @@ -590,6 +593,7 @@ class _defs_edit_curve: return dict( text="Draw", +cursor='PAINT_BRUSH', icon=None, widget=None, keymap=( ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bf375544cc3] greasepencil-object: Cleanup: use function to free weights
Commit: bf375544cc35a7370ca8e214ab24d014f7e1c416 Author: Campbell Barton Date: Fri May 18 12:16:49 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBbf375544cc35a7370ca8e214ab24d014f7e1c416 Cleanup: use function to free weights === M source/blender/editors/gpencil/gpencil_interpolate.c === diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 21ec40beab9..9e611d8e8ee 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -61,6 +61,7 @@ #include "BKE_library.h" #include "BKE_report.h" #include "BKE_screen.h" +#include "BKE_deform.h" #include "UI_interface.h" #include "UI_resources.h" @@ -1007,11 +1008,7 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op) /* if destination stroke is smaller, resize new_stroke to size of gps_to stroke */ if (gps_from->totpoints > gps_to->totpoints) { /* free weights of removed points */ - for (int i = gps_to->totpoints; i < gps_from->totpoints; i++) { - bGPDspoint *pt = &gps_from->points[i]; - MDeformVert *dvert = &gps_from->dvert[i]; - BKE_gpencil_free_point_weights(dvert); - } + BKE_defvert_array_free_elems(gps_from->dvert + gps_to->totpoints, gps_from->totpoints - gps_to->totpoints); new_stroke->points = MEM_recallocN(new_stroke->points, sizeof(*new_stroke->points) * gps_to->totpoints); new_stroke->dvert = MEM_recallocN(new_stroke->dvert, sizeof(*new_stroke->dvert) * gps_to->totpoints); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3eab7fa5125] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Commit: 3eab7fa5125e6f63da1fa93d43fa225621d743b1 Author: Campbell Barton Date: Fri May 18 12:19:37 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB3eab7fa5125e6f63da1fa93d43fa225621d743b1 Merge branch 'blender2.8' into greasepencil-object === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fbcdd07c98c] blender2.8: Cleanup: move unneeded struct out of DNA.
Commit: fbcdd07c98c71d1db19cd79634df6c6a77bb24b2 Author: Brecht Van Lommel Date: Thu May 17 15:05:17 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBfbcdd07c98c71d1db19cd79634df6c6a77bb24b2 Cleanup: move unneeded struct out of DNA. The real reason is that there is a conflict between Carbon header defining a "Collection" struct, and this works around it. === M source/blender/editors/include/ED_fileselect.h M source/blender/editors/space_file/fsmenu.c M source/blender/makesdna/DNA_space_types.h M source/blender/makesrna/intern/rna_space.c === diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index 92acfa6c1d2..645c3e6d75e 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -113,6 +113,17 @@ void ED_file_change_dir(struct bContext *C); /* File menu stuff */ +/* FSMenuEntry's without paths indicate separators */ +typedef struct FSMenuEntry { + struct FSMenuEntry *next; + + char *path; + char name[256]; /* FILE_MAXFILE */ + short save; + short valid; + short pad[2]; +} FSMenuEntry; + typedef enum FSMenuCategory { FS_CATEGORY_SYSTEM, FS_CATEGORY_SYSTEM_BOOKMARKS, diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index ee0ec3fda39..ea251f2018c 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -42,8 +42,6 @@ #include "BKE_appdir.h" -#include "DNA_space_types.h" - #include "ED_fileselect.h" #ifdef WIN32 diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 1f2664d04eb..d24aec739e1 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -666,17 +666,6 @@ typedef struct SpaceFile { short systemnr, system_bookmarknr; } SpaceFile; -/* FSMenuEntry's without paths indicate separators */ -typedef struct FSMenuEntry { - struct FSMenuEntry *next; - - char *path; - char name[256]; /* FILE_MAXFILE */ - short save; - short valid; - short pad[2]; -} FSMenuEntry; - /* FileSelectParams.display */ enum eFileDisplayType { FILE_DEFAULTDISPLAY = 0, diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 3ce799dfb88..29a204963cb 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1661,6 +1661,18 @@ static int rna_FileBrowser_FSMenuEntry_name_get_editable(PointerRNA *ptr, const return fsm->save ? PROP_EDITABLE : 0; } +static int rna_FileBrowser_FSMenuEntry_use_save_get(PointerRNA *ptr) +{ + FSMenuEntry *fsm = ptr->data; + return fsm->save; +} + +static int rna_FileBrowser_FSMenuEntry_is_valid_get(PointerRNA *ptr) +{ + FSMenuEntry *fsm = ptr->data; + return fsm->valid; +} + static void rna_FileBrowser_FSMenu_next(CollectionPropertyIterator *iter) { ListBaseIterator *internal = &iter->internal.listbase; @@ -4039,14 +4051,12 @@ static void rna_def_filemenu_entry(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters"); prop = RNA_def_property(srna, "path", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_sdna(prop, NULL, "path"); RNA_def_property_string_funcs(prop, "rna_FileBrowser_FSMenuEntry_path_get", "rna_FileBrowser_FSMenuEntry_path_length", "rna_FileBrowser_FSMenuEntry_path_set"); RNA_def_property_ui_text(prop, "Path", ""); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_funcs(prop, "rna_FileBrowser_FSMenuEntry_name_get", "rna_FileBrowser_FSMenuEntry_name_length", "rna_FileBrowser_FSMenuEntry_name_set"); @@ -4055,12 +4065,12 @@ static void rna_def_filemenu_entry(BlenderRNA *brna) RNA_def_struct_name_property(srna, prop); prop = RNA_def_property(srna, "use_save", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "save", 1); + RNA_def_property_boolean_funcs(prop, "rna_FileBrowser_FSMenuEntry_use_save_get", NULL); RNA_def_property_ui_text(prop, "Save", "Whether this path is saved in bookmarks, or generated from OS"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "valid", 1); +
[Bf-blender-cvs] [17bd5c9d4b1] blender2.8: Collections and groups unification
Commit: 17bd5c9d4b1e9377b896c13043e24eaa7e979714 Author: Brecht Van Lommel Date: Mon Apr 30 15:57:22 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB17bd5c9d4b1e9377b896c13043e24eaa7e979714 Collections and groups unification OVERVIEW * In 2.7 terminology, all layers and groups are now collection datablocks. * These collections are nestable, linkable, instanceable, overrideable, .. which opens up new ways to set up scenes and link + override data. * Viewport/render visibility and selectability are now a part of the collection and shared across all view layers and linkable. * View layers define which subset of the scene collection hierarchy is excluded for each. For many workflows one view layer can be used, these are more of an advanced feature now. OUTLINER * The outliner now has a "View Layer" display mode instead of "Collections", which can display the collections and/or objects in the view layer. * In this display mode, collections can be excluded with the right click menu. These will then be greyed out and their objects will be excluded. * To view collections not linked to any scene, the "Blender File" display mode can be used, with the new filtering option to just see Colleciton datablocks. * The outliner right click menus for collections and objects were reorganized. * Drag and drop still needs to be improved. Like before, dragging the icon or text gives different results, we'll unify this later. LINKING AND OVERRIDES * Collections can now be linked into the scene without creating an instance, with the link/append operator or from the collections view in the outliner. * Collections can get static overrides with the right click menu in the outliner, but this is rather unreliable and not clearly communicated at the moment. * We still need to improve the make override operator to turn collection instances into collections with overrides directly in the scene. PERFORMANCE * We tried to make performance not worse than before and improve it in some cases. The main thing that's still a bit slower is multiple scenes, we have to change the layer syncing to only updated affected scenes. * Collections keep a list of their parent collections for faster incremental updates in syncing and caching. * View layer bases are now in a object -> base hash to avoid quadratic time lookups internally and in API functions like visible_get(). VERSIONING * Compatibility with 2.7 files should be improved due to the new visibility controls. Of course users may not want to set up their scenes differently now to avoid having separate layers and groups. * Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero files. There's a few things which are know to be not quite compatible, like nested layer collections inside groups. * The versioning code for 2.8 files is quite complicated, and isolated behind #ifdef so it can be removed at the end of the release cycle. KNOWN ISSUES * The G-key group operators in the 3D viewport were left mostly as is, they need to be modified still to fit better. * Same for the groups panel in the object properties. This needs to be updated still, or perhaps replaced by something better. * Collections must all have a unique name. Less restrictive namespacing is to be done later, we'll have to see how important this is as all objects within the collections must also have a unique name anyway. * Full scene copy and delete scene are exactly doing the right thing yet. Differential Revision: https://developer.blender.org/D3383 https://code.blender.org/2018/05/collections-and-groups/ === M doc/python_api/examples/bpy.ops.2.py M release/scripts/modules/bl_previews_utils/bl_previews_render.py M release/scripts/modules/bpy_types.py M release/scripts/startup/bl_operators/file.py M release/scripts/startup/bl_ui/__init__.py D release/scripts/startup/bl_ui/properties_collection.py M release/scripts/startup/bl_ui/properties_object.py M release/scripts/startup/bl_ui/space_dopesheet.py M release/scripts/startup/bl_ui/space_outliner.py M release/scripts/startup/bl_ui/space_view3d.py M source/blender/alembic/intern/abc_exporter.cc M source/blender/alembic/intern/alembic_capi.cc M source/blender/blenkernel/BKE_blender_version.h M source/blender/blenkernel/BKE_collection.h M source/blender/blenkernel/BKE_collision.h M source/blender/blenkernel/BKE_context.h M source/blender/blenkernel/BKE_effect.h M source/blender/blenkernel/BKE_freestyle.h D source/blender/blenkernel/BKE_group.h M source/blender/blenkernel/BKE_layer.h M source/blender/blenkernel/BKE_main.h M source/blender/blenkernel/BKE_object.h M source/blender/blenkernel/BKE_scene.h M source/blender/blenkernel/CMakeLists.txt M source/blender/blenkernel/inter
[Bf-blender-cvs] [70aec3732d0] blender2.8: Fix crash running in background mode, after recent changes.
Commit: 70aec3732d0f03138d6477fd04c81dfd9fd21256 Author: Brecht Van Lommel Date: Fri May 18 13:23:14 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB70aec3732d0f03138d6477fd04c81dfd9fd21256 Fix crash running in background mode, after recent changes. === M source/blender/editors/screen/screen_edit.c === diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 7167b48c06e..77f7aacb68e 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -848,7 +848,9 @@ void ED_screens_initialize(wmWindowManager *wm) ED_screen_global_areas_create(win); } ED_screen_refresh(wm, win); - ED_screen_set_active_region(NULL, win, &win->eventstate->x); + if (win->eventstate) { + ED_screen_set_active_region(NULL, win, &win->eventstate->x); + } } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [cb50c288d40] master: Add missing header
Commit: cb50c288d40155684c57eb6bfe5a1730edd190e7 Author: Campbell Barton Date: Fri May 18 13:43:30 2018 +0200 Branches: master https://developer.blender.org/rBcb50c288d40155684c57eb6bfe5a1730edd190e7 Add missing header === M source/creator/creator_args.c === diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index 4b5038d89df..3da8a6bb898 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -45,6 +45,7 @@ #include "BLI_path_util.h" #include "BLI_fileops.h" #include "BLI_mempool.h" +#include "BLI_system.h" #include "BLO_readfile.h" /* only for BLO_has_bfile_extension */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b167bc2f008] blender2.8: Merge branch 'master' into blender2.8
Commit: b167bc2f008522427deab016ca0fd55b01920abf Author: Campbell Barton Date: Fri May 18 13:45:48 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBb167bc2f008522427deab016ca0fd55b01920abf Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1cc4ab481e8] master: Fix crash drawing polygon curves
Commit: 1cc4ab481e87c0e3f459302bffbdf029545fd42d Author: Campbell Barton Date: Fri May 18 14:23:53 2018 +0200 Branches: master https://developer.blender.org/rB1cc4ab481e87c0e3f459302bffbdf029545fd42d Fix crash drawing polygon curves === M source/blender/editors/curve/editcurve_paint.c === diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index 0d7cb089c4f..36d9f8a4c55 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -978,9 +978,16 @@ static int curve_draw_exec(bContext *C, wmOperator *op) const struct StrokeElem *selem; nu->pntsu = stroke_len; + nu->pntsv = 1; nu->type = CU_POLY; nu->bp = MEM_callocN(nu->pntsu * sizeof(BPoint), __func__); + /* Misc settings. */ + nu->resolu = cu->resolu; + nu->resolv = 1; + nu->orderu = 4; + nu->orderv = 1; + BPoint *bp = nu->bp; BLI_mempool_iternew(cdd->stroke_elem_pool, &iter); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5e7a21a5f54] master: Fix T55115: crash when iterating SmokeDomainSettings color_grid property through python
Commit: 5e7a21a5f549f5db73385820cafcd8f2bb9c91da Author: Philipp Oeser Date: Fri May 18 12:58:46 2018 +0200 Branches: master https://developer.blender.org/rB5e7a21a5f549f5db73385820cafcd8f2bb9c91da Fix T55115: crash when iterating SmokeDomainSettings color_grid property through python === M source/blender/makesrna/intern/rna_smoke.c === diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 38c297def32..b860ad303f0 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -286,20 +286,27 @@ static void rna_SmokeModifier_color_grid_get(PointerRNA *ptr, float *values) { #ifdef WITH_SMOKE SmokeDomainSettings *sds = (SmokeDomainSettings *)ptr->data; + int length[RNA_MAX_ARRAY_DIMENSION]; + int size = rna_SmokeModifier_grid_get_length(ptr, length); BLI_rw_mutex_lock(sds->fluid_mutex, THREAD_LOCK_READ); - if (sds->flags & MOD_SMOKE_HIGHRES) { - if (smoke_turbulence_has_colors(sds->wt)) - smoke_turbulence_get_rgba(sds->wt, values, 0); - else - smoke_turbulence_get_rgba_from_density(sds->wt, sds->active_color, values, 0); + if (!sds->fluid) { + memset(values, 0, size * sizeof(float)); } else { - if (smoke_has_colors(sds->fluid)) - smoke_get_rgba(sds->fluid, values, 0); - else - smoke_get_rgba_from_density(sds->fluid, sds->active_color, values, 0); + if (sds->flags & MOD_SMOKE_HIGHRES) { + if (smoke_turbulence_has_colors(sds->wt)) + smoke_turbulence_get_rgba(sds->wt, values, 0); + else + smoke_turbulence_get_rgba_from_density(sds->wt, sds->active_color, values, 0); + } + else { + if (smoke_has_colors(sds->fluid)) + smoke_get_rgba(sds->fluid, values, 0); + else + smoke_get_rgba_from_density(sds->fluid, sds->active_color, values, 0); + } } BLI_rw_mutex_unlock(sds->fluid_mutex); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6e48afeb238] blender2.8: Merge branch 'master' into blender2.8
Commit: 6e48afeb238b5935273891048be80b9a3a78027f Author: Philipp Oeser Date: Fri May 18 14:59:38 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB6e48afeb238b5935273891048be80b9a3a78027f Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e0772857455] master: CMake: Add WITH_COMPILER_ASAN option
Commit: e0772857455f1bf0663a56291f727883b9595d7b Author: Campbell Barton Date: Fri May 18 15:21:18 2018 +0200 Branches: master https://developer.blender.org/rBe0772857455f1bf0663a56291f727883b9595d7b CMake: Add WITH_COMPILER_ASAN option This supports easy toggling of Address Sanitizer. === M CMakeLists.txt === diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e23b5f9986..0388e251b6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -527,6 +527,41 @@ if(CMAKE_COMPILER_IS_GNUCC) mark_as_advanced(WITH_LINKER_GOLD) endif() +if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") + option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF) + mark_as_advanced(WITH_COMPILER_ASAN) + + if(WITH_COMPILER_ASAN) + set(_asan_defaults "\ +-fsanitize=address \ +-fsanitize=bool \ +-fsanitize=bounds \ +-fsanitize=enum \ +-fsanitize=float-cast-overflow \ +-fsanitize=float-divide-by-zero \ +-fsanitize=leak \ +-fsanitize=nonnull-attribute \ +-fsanitize=object-size \ +-fsanitize=returns-nonnull-attribute \ +-fsanitize=signed-integer-overflow \ +-fsanitize=undefined \ +-fsanitize=vla-bound \ +-fno-sanitize=alignment \ +") + + set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer") + mark_as_advanced(COMPILER_ASAN_CFLAGS) + set(COMPILER_ASAN_CXXFLAGS "${_asan_defaults}" CACHE STRING "C++ flags for address sanitizer") + mark_as_advanced(COMPILER_ASAN_CXXFLAGS) + + unset(_asan_defaults) + + find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) + mark_as_advanced(COMPILER_ASAN_LIBRARY) + + endif() +endif() + # Dependency graph option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON) mark_as_advanced(WITH_LEGACY_DEPSGRAPH) @@ -822,6 +857,15 @@ set(PLATFORM_LINKLIBS "") set(PLATFORM_LINKFLAGS "") set(PLATFORM_LINKFLAGS_DEBUG "") +if(WITH_COMPILER_ASAN) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}") + + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}") + + set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY}") +endif() #- #Platform specifics ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4d19f24ba74] master: Cleanup: remove deprecated definitions
Commit: 4d19f24ba74c6c08d7add7946856e8af1e1e5640 Author: Campbell Barton Date: Fri May 18 14:26:02 2018 +0200 Branches: master https://developer.blender.org/rB4d19f24ba74c6c08d7add7946856e8af1e1e5640 Cleanup: remove deprecated definitions === M CMakeLists.txt === diff --git a/CMakeLists.txt b/CMakeLists.txt index f0930866d64..3e23b5f9986 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,21 +66,12 @@ endif() # set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) # global compile definitions since add_definitions() adds for all. - -if(NOT (${CMAKE_VERSION} VERSION_LESS 3.0)) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS - $<$:DEBUG;_DEBUG> - $<$:NDEBUG> - $<$:NDEBUG> - $<$:NDEBUG> - ) -else() - # keep until CMake-3.0 is min requirement - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG _DEBUG) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE NDEBUG) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL NDEBUG) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO NDEBUG) -endif() +set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS + $<$:DEBUG;_DEBUG> + $<$:NDEBUG> + $<$:NDEBUG> + $<$:NDEBUG> +) #- # Set policy ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [83c2febaeeb] blender2.8: Eevee: SSS: Fix compilation errors.
Commit: 83c2febaeeb2627ad8850ee635b6dba66a65d572 Author: Clément Foucault Date: Fri May 18 15:31:07 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB83c2febaeeb2627ad8850ee635b6dba66a65d572 Eevee: SSS: Fix compilation errors. Fix T55114 === M source/blender/gpu/shaders/gpu_shader_material.glsl === diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 04179787410..81672b6a046 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -2571,9 +2571,9 @@ void node_shadertorgb(Closure cl, out vec4 outcol, out float outalpha) # ifdef USE_SSS # ifdef USE_SSS_ALBEDO - outcol += (cl.sss_data * cl.sss_albedo); + outcol.rgb += cl.sss_data.rgb * cl.sss_albedo; # else - outcol += cl.sss_data; + outcol.rgb += cl.sss_data.rgb; # endif # endif } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [47949fd764c] blender2.8: Eevee: Codestyle fix.
Commit: 47949fd764c8f7af7dc560794a38d47d63e9ee63 Author: Clément Foucault Date: Fri May 18 15:33:04 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB47949fd764c8f7af7dc560794a38d47d63e9ee63 Eevee: Codestyle fix. === M source/blender/gpu/shaders/gpu_shader_material.glsl M source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c === diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 81672b6a046..4306fe17e96 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -2554,7 +2554,7 @@ void node_eevee_specular( result.ssr_id = int(ssr_id); } -void node_shadertorgb(Closure cl, out vec4 outcol, out float outalpha) +void node_shader_to_rgba(Closure cl, out vec4 outcol, out float outalpha) { vec4 spec_accum = vec4(0.0); if (ssrToggle && cl.ssr_id == outputSsrId) { diff --git a/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c b/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c index 286752f9a10..c565c311efc 100644 --- a/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c @@ -42,7 +42,7 @@ static bNodeSocketTemplate sh_node_shadertorgb_out[] = { static int node_shader_gpu_shadertorgb(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) { - return GPU_stack_link(mat, node, "node_shadertorgb", in, out); + return GPU_stack_link(mat, node, "node_shader_to_rgba", in, out); } /* node type definition */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6a64556ba1c] blender2.8: Merge branch 'master' into blender2.8
Commit: 6a64556ba1c82f1f9378989f87b58abc1540da12 Author: Campbell Barton Date: Fri May 18 15:31:53 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB6a64556ba1c82f1f9378989f87b58abc1540da12 Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d7ba8611e29] blender2.8: Fix crash with shape keys and modifier stack, after recent changes.
Commit: d7ba8611e29a7cc188b3297a74338905f5dfa491 Author: Brecht Van Lommel Date: Fri May 18 15:10:48 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBd7ba8611e29a7cc188b3297a74338905f5dfa491 Fix crash with shape keys and modifier stack, after recent changes. === M source/blender/blenkernel/intern/DerivedMesh.c === diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index abbfa4b7ff1..bcb45b199d2 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -827,8 +827,9 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob, CustomDataMask mask, bool * stack */ if (tmp.totvert != me->totvert && !did_shapekeys && me->key) { printf("%s: YEEK! this should be recoded! Shape key loss!: ID '%s'\n", __func__, tmp.id.name); - if (tmp.key) + if (tmp.key && !(tmp.id.tag & LIB_TAG_NO_MAIN)) { id_us_min(&tmp.key->id); + } tmp.key = NULL; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6776a55464d] blender2.8: Fix crash rendering files with Python errors in background mode.
Commit: 6776a55464db795c3eb83f1323d93960f725f3a8 Author: Brecht Van Lommel Date: Fri May 18 15:49:03 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB6776a55464db795c3eb83f1323d93960f725f3a8 Fix crash rendering files with Python errors in background mode. === M source/blender/windowmanager/intern/wm_event_system.c === diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 74de77ee1c2..d38416e490d 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -788,7 +788,7 @@ void WM_reportf(ReportType type, const char *format, ...) /* (caller_owns_reports == true) when called from python */ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, bool caller_owns_reports) { - if (caller_owns_reports == false) { /* popup */ + if (G.background == 0 && caller_owns_reports == false) { /* popup */ if (op->reports->list.first) { /* FIXME, temp setting window, see other call to UI_popup_menu_reports for why */ wmWindow *win_prev = CTX_wm_window(C); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [db2c966e2c8] blender2.8: Cleanup: remove unused function.
Commit: db2c966e2c8e66f0de6caa3e4a1a5a96bcfbf843 Author: Germano Date: Thu May 17 13:38:23 2018 -0300 Branches: blender2.8 https://developer.blender.org/rBdb2c966e2c8e66f0de6caa3e4a1a5a96bcfbf843 Cleanup: remove unused function. === M source/blender/editors/transform/transform_snap_object.c === diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index ec3f9793889..c24f3bf01f8 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -197,14 +197,6 @@ static void iter_snap_objects( } -MINLINE float depth_get(const float co[3], const float ray_start[3], const float ray_dir[3]) -{ - float dvec[3]; - sub_v3_v3v3(dvec, co, ray_start); - return dot_v3v3(dvec, ray_dir); -} - - static bool walk_parent_bvhroot_cb(const BVHTreeAxisRange *bounds, void *userdata) { BVHTreeRay *ray = userdata; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a3070474e29] blender2.8: Clear the ParticleSettings pointer to prevent doubly-freeing it
Commit: a3070474e29d6e17e5055397741c70c4dc166ace Author: Sybren A. Stüvel Date: Fri May 18 16:29:01 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBa3070474e29d6e17e5055397741c70c4dc166ace Clear the ParticleSettings pointer to prevent doubly-freeing it Not happy with the approach, as it adds to nested_id_hack_discard_pointers(), but at least it fixes a crash. === M source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc === diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 40f9402abc8..c8b9702621e 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -135,6 +135,15 @@ void nested_id_hack_discard_pointers(ID *id_cow) SPECIAL_CASE(ID_LT, Lattice, key) SPECIAL_CASE(ID_ME, Mesh, key) + case ID_OB: + { + /* Clear the ParticleSettings pointer to prevent doubly-freeing it. */ + Object *ob = (Object *)id_cow; + LISTBASE_FOREACH(ParticleSystem *, psys, &ob->particlesystem) { + psys->part = NULL; + } + break; + } # undef SPECIAL_CASE default: ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2d6bfb5b63c] blender2.8: Transform: Improve the hierarchy in the choice of snapped elements in the mixed snap.
Commit: 2d6bfb5b63cdb92422e6b6d8e2ff58f844b7ed94 Author: Germano Date: Fri May 18 11:40:32 2018 -0300 Branches: blender2.8 https://developer.blender.org/rB2d6bfb5b63cdb92422e6b6d8e2ff58f844b7ed94 Transform: Improve the hierarchy in the choice of snapped elements in the mixed snap. To snap to small edges in 3d_view is no longer obfuscated by vertices if then is also enabled. === M source/blender/editors/transform/transform_snap_object.c === diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index c24f3bf01f8..26288b162f7 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -80,7 +80,7 @@ enum eViewProj { }; typedef struct SnapData { - short snap_to; + short snap_to_flag; float mval[2]; float pmat[4][4]; /* perspective matrix */ float win_size[2];/* win x and y */ @@ -933,128 +933,6 @@ static bool test_projected_edge_dist( is_persp, near_co, dist_px_sq, r_co); } -static bool snapMeshPolygon( -SnapObjectContext *sctx, SnapData *snapdata, -Object *ob, float obmat[4][4], -/* read/write args */ -float *dist_px, -/* return args */ -float r_loc[3], float r_no[3], int *r_index) -{ - bool retval = false; - - float lpmat[4][4], dist_px_sq = SQUARE(*dist_px); - mul_m4_m4m4(lpmat, snapdata->pmat, obmat); - - struct DistProjectedAABBPrecalc neasrest_precalc; - dist_squared_to_projected_aabb_precalc( - &neasrest_precalc, lpmat, snapdata->win_size, snapdata->mval); - - float tobmat[4][4], clip_planes_local[MAX_CLIPPLANE_LEN][4]; - transpose_m4_m4(tobmat, obmat); - for (int i = snapdata->clip_plane_len; i--;) { - mul_v4_m4v4(clip_planes_local[i], tobmat, snapdata->clip_plane[i]); - } - - bool is_persp = snapdata->view_proj == VIEW_PROJ_PERSP; - - SnapObjectData *sod = BLI_ghash_lookup(sctx->cache.object_map, ob); - BLI_assert(sod != NULL); - - if (sod->type == SNAP_MESH) { - Mesh *me = ob->data; - MPoly *mp = &me->mpoly[*r_index]; - - const MLoop *ml = &me->mloop[mp->loopstart]; - for (int i = mp->totloop; i--; ml++) { - if (snapdata->snap_to == SCE_SNAP_MODE_VERTEX) { - const MVert *vert = &me->mvert[ml->v]; - if (test_projected_vert_dist( - &neasrest_precalc, - clip_planes_local, snapdata->clip_plane_len, - is_persp, vert->co, - &dist_px_sq, r_loc)) - { - normal_short_to_float_v3(r_no, vert->no); - *r_index = ml->v; - retval = true; - } - } - else { - float co_pair[2][3]; - const MEdge *edge = &me->medge[ml->e]; - copy_v3_v3(co_pair[0], me->mvert[edge->v1].co); - copy_v3_v3(co_pair[1], me->mvert[edge->v2].co); - if (test_projected_edge_dist( - &neasrest_precalc, - clip_planes_local, snapdata->clip_plane_len, - is_persp, co_pair[0], co_pair[1], - &dist_px_sq, r_loc)) - { - sub_v3_v3v3(r_no, co_pair[0], co_pair[1]); - *r_index = ml->e; - retval = true; - } - } - } - } - else { - BLI_assert(sod->type == SNAP_EDIT_MESH); - - BMEditMesh *em = BKE_editmesh_from_object(ob); - BM_mesh_elem_table_ensure(em->bm, BM_FACE); - BMFace *f = BM_face_at_index(em->bm, *r_index); - - BMLoop *l_iter, *l_first; - l_iter = l_first = BM_FACE_FIRST_LOOP(f); - - do { - if (snapdata->snap_to == SCE_SNAP_MODE_VERTEX) { - const float *co = l_iter->v->co; - if (test_projected_vert_dist( - &neasrest_precalc, - clip_planes_local, snapdata->clip_plane_len, -
[Bf-blender-cvs] [d712dd2f19a] master: Cycles tests: move to render/ folder, to share with Eevee.
Commit: d712dd2f19a25a992761f881bdaabc85334cab05 Author: Brecht Van Lommel Date: Fri May 18 16:46:48 2018 +0200 Branches: master https://developer.blender.org/rBd712dd2f19a25a992761f881bdaabc85334cab05 Cycles tests: move to render/ folder, to share with Eevee. === M tests/python/CMakeLists.txt === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 9b1807b796b..0a6e2e4909c 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -532,13 +532,13 @@ function(add_python_test testname testscript) endfunction() if(WITH_CYCLES) - if(OPENIMAGEIO_IDIFF AND EXISTS "${TEST_SRC_DIR}/cycles/ctests/shader") + if(OPENIMAGEIO_IDIFF AND EXISTS "${TEST_SRC_DIR}/render/ctests/shader") macro(add_cycles_render_test subject) add_python_test( cycles_${subject}_test ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py -blender "$" - -testdir "${TEST_SRC_DIR}/cycles/ctests/${subject}" + -testdir "${TEST_SRC_DIR}/render/ctests/${subject}" -idiff "${OPENIMAGEIO_IDIFF}" -outdir "${TEST_OUT_DIR}/cycles" ) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [29595334f06] blender2.8: COW Fix: POSE_OT_armature_apply (Apply Pose as Rest Pose) now works with COW
Commit: 29595334f06107c484e928358715b55dac3e840d Author: Joshua Leung Date: Fri May 18 17:07:41 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB29595334f06107c484e928358715b55dac3e840d COW Fix: POSE_OT_armature_apply (Apply Pose as Rest Pose) now works with COW === M source/blender/editors/armature/pose_transform.c === diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c index 1da8e24bd00..af9d94c0bac 100644 --- a/source/blender/editors/armature/pose_transform.c +++ b/source/blender/editors/armature/pose_transform.c @@ -100,6 +100,7 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op) Depsgraph *depsgraph = CTX_data_depsgraph(C); Scene *scene = CTX_data_scene(C); Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); // must be active object, not edit-object + const Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); bArmature *arm = BKE_armature_from_object(ob); bPose *pose; bPoseChannel *pchan; @@ -127,11 +128,12 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op) pose = ob->pose; for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { + const bPoseChannel *pchan_eval = BKE_pose_channel_find_name(ob_eval->pose, pchan->name); curbone = ED_armature_ebone_find_name(arm->edbo, pchan->name); /* simply copy the head/tail values from pchan over to curbone */ - copy_v3_v3(curbone->head, pchan->pose_head); - copy_v3_v3(curbone->tail, pchan->pose_tail); + copy_v3_v3(curbone->head, pchan_eval->pose_head); + copy_v3_v3(curbone->tail, pchan_eval->pose_tail); /* fix roll: * 1. find auto-calculated roll value for this bone now @@ -147,7 +149,7 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op) invert_m3_m3(imat, premat); /* get pchan 'visual' matrix */ - copy_m3_m4(pmat, pchan->pose_mat); + copy_m3_m4(pmat, pchan_eval->pose_mat); /* remove auto from visual and get euler rotation */ mul_m3_m3m3(tmat, imat, pmat); @@ -161,17 +163,19 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op) * then clear the pchan values (so we don't get a double-up) */ if (pchan->bone->segments > 1) { - curbone->curveInX += pchan->curveInX; - curbone->curveInY += pchan->curveInY; - curbone->curveOutX += pchan->curveOutX; - curbone->curveOutY += pchan->curveOutY; - curbone->roll1 += pchan->roll1; - curbone->roll2 += pchan->roll2; - curbone->ease1 += pchan->ease1; - curbone->ease2 += pchan->ease2; - curbone->scaleIn += pchan->scaleIn; - curbone->scaleOut += pchan->scaleOut; + /* combine rest/pose values */ + curbone->curveInX += pchan_eval->curveInX; + curbone->curveInY += pchan_eval->curveInY; + curbone->curveOutX += pchan_eval->curveOutX; + curbone->curveOutY += pchan_eval->curveOutY; + curbone->roll1 += pchan_eval->roll1; + curbone->roll2 += pchan_eval->roll2; + curbone->ease1 += pchan_eval->ease1; + curbone->ease2 += pchan_eval->ease2; + curbone->scaleIn += pchan_eval->scaleIn; + curbone->scaleOut += pchan_eval->scaleOut; + /* reset pose values */ pchan->curveInX = pchan->curveOutX = 0.0f; pchan->curveInY = pchan->curveOutY = 0.0f; pchan->roll1 = pchan->roll2 = 0.0f; @@ -202,6 +206,7 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op) /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob); + DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE); return OPERATOR_FINISHED; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [00071d78bcf] blender2.8: Merge branch 'master' into blender2.8
Commit: 00071d78bcfbe8ae0c813c769af075f069d2cb8d Author: Brecht Van Lommel Date: Fri May 18 17:11:19 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB00071d78bcfbe8ae0c813c769af075f069d2cb8d Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6a782ed767f] blender2.8: Eevee: add regression tests.
Commit: 6a782ed767f993404cd5ba1cd233f49f9fffaaf2 Author: Brecht Van Lommel Date: Fri May 18 16:40:41 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB6a782ed767f993404cd5ba1cd233f49f9fffaaf2 Eevee: add regression tests. This adds Eevee render tests using the Cycles files. Currently it must be enabled by setting WITH_OPENGL_RENDER_TESTS=ON. Once we have reference images we can enable it by default. Some of the Cycles and Eevee tests are also currently broken due to modifier and particle changes. Differential Revision: https://developer.blender.org/D3182 === M tests/python/CMakeLists.txt M tests/python/cycles_render_tests.py A tests/python/eevee_render_tests.py M tests/python/modules/render_report.py === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 50e2927f54f..d5ba68b9b93 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -531,9 +531,9 @@ function(add_python_test testname testscript) endif() endfunction() -if(WITH_CYCLES) - if(OPENIMAGEIO_IDIFF AND EXISTS "${TEST_SRC_DIR}/render/ctests/shader") - macro(add_cycles_render_test subject) +if(OPENIMAGEIO_IDIFF AND EXISTS "${TEST_SRC_DIR}/render/ctests/shader") + macro(add_cycles_render_test subject) + if(WITH_CYCLES) add_python_test( cycles_${subject}_test ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py @@ -542,31 +542,39 @@ if(WITH_CYCLES) -idiff "${OPENIMAGEIO_IDIFF}" -outdir "${TEST_OUT_DIR}/cycles" ) - endmacro() - if(WITH_OPENGL_RENDER_TESTS) - add_cycles_render_test(opengl) endif() - add_cycles_render_test(bake) - add_cycles_render_test(bsdf) - add_cycles_render_test(denoise) - add_cycles_render_test(displacement) - add_cycles_render_test(hair) - add_cycles_render_test(image_data_types) - add_cycles_render_test(image_mapping) - add_cycles_render_test(image_texture_limit) - add_cycles_render_test(integrator) - add_cycles_render_test(light) - add_cycles_render_test(mesh) - add_cycles_render_test(motion_blur) - add_cycles_render_test(render_layer) - add_cycles_render_test(reports) - add_cycles_render_test(shader) - add_cycles_render_test(shadow_catcher) - add_cycles_render_test(sss) - add_cycles_render_test(volume) - else() - MESSAGE(STATUS "Disabling Cycles tests because tests folder does not exist") - endif() + + if(WITH_OPENGL_RENDER_TESTS AND (NOT ${subject} MATCHES "bake")) + add_python_test( + eevee_${subject}_test + ${CMAKE_CURRENT_LIST_DIR}/eevee_render_tests.py + -blender "$" + -testdir "${TEST_SRC_DIR}/render/ctests/${subject}" + -idiff "${OPENIMAGEIO_IDIFF}" + -outdir "${TEST_OUT_DIR}/eevee" + ) + endif() + endmacro() + add_cycles_render_test(bake) + add_cycles_render_test(bsdf) + add_cycles_render_test(denoise) + add_cycles_render_test(displacement) + add_cycles_render_test(hair) + add_cycles_render_test(image_data_types) + add_cycles_render_test(image_mapping) + add_cycles_render_test(image_texture_limit) + add_cycles_render_test(integrator) + add_cycles_render_test(light) + add_cycles_render_test(mesh) + add_cycles_render_test(motion_blur) + add_cycles_render_test(render_layer) + add_cycles_render_test(reports) + add_cycles_render_test(shader) + add_cycles_render_test(shadow_catcher) + add_cycles_render_test(sss) + add_cycles_render_test(volume) +elseif(WITH_CYCLES) + MESSAGE(STATUS "Disabling Cycles tests because tests folder does not exist") endif() if(WITH_OPENGL_DRAW_TESTS) diff --git a/tests/python/cycles_render_tests.py b/tests/python/cycles_render_tests.py index a01a6f74e15..eb7a1d96d24 100755 --- a/tests/python/cycles_render_tests.py +++ b/tests/python/cycles_render_tests.py @@ -77,6 +77,7 @@ def render_file(filepath, output_filepath): shutil.copy(frame_filepath, output_filepath) os.remove(frame_filepath) if VERBOSE: +print(" ".join(command)) print(output.decode("utf-8")) return None except subproces
[Bf-blender-cvs] [b2db8c07b9a] hair_guides: More detailed API for partially updating hair export caches.
Commit: b2db8c07b9a9c2aa910dd21fec211228f6a69361 Author: Lukas Tönne Date: Fri May 18 16:27:37 2018 +0100 Branches: hair_guides https://developer.blender.org/rBb2db8c07b9a9c2aa910dd21fec211228f6a69361 More detailed API for partially updating hair export caches. This will allow proper caching of draw data as well as optimization of GPU buffer uploads when only guide curve deform changes. === M source/blender/blenkernel/BKE_hair.h M source/blender/blenkernel/intern/hair.c M source/blender/makesdna/DNA_particle_types.h === diff --git a/source/blender/blenkernel/BKE_hair.h b/source/blender/blenkernel/BKE_hair.h index 34eb9d2df3a..d1ad0f10504 100644 --- a/source/blender/blenkernel/BKE_hair.h +++ b/source/blender/blenkernel/BKE_hair.h @@ -135,10 +135,62 @@ typedef struct HairExportCache const struct HairFollicle *follicles; } HairExportCache; +/* Identifiers for data stored in hair export caches. + * Note some flags include dependent parts, which automatically + * invalidates those parts when their dependencies are invalidated. + * + * In particular: guide vertex locations can be changed without having to update fiber base data, + * which allows animation of guide curves without rebuilding fiber data apart from final locations. + */ +typedef enum eHairExportCacheUpdateFlags +{ + /* Follicle placement on the scalp mesh */ + HAIR_EXPORT_FIBER_ROOT_POSITIONS = (1 << 0), + /* Fiber vertex counts */ + HAIR_EXPORT_FIBER_VERTEX_COUNTS = (1 << 1), + /* Follicle parent indices and weights */ + HAIR_EXPORT_FOLLICLE_BINDING= (1 << 2) | HAIR_EXPORT_FIBER_ROOT_POSITIONS | HAIR_EXPORT_FIBER_VERTEX_COUNTS, + /* Guide vertex positions (deform only) */ + HAIR_EXPORT_GUIDE_VERTICES = (1 << 3), + /* Guide curve number and vertex counts (topology changes) */ + HAIR_EXPORT_GUIDE_CURVES= (1 << 4) | HAIR_EXPORT_GUIDE_VERTICES | HAIR_EXPORT_FOLLICLE_BINDING, + + HAIR_EXPORT_ALL = + HAIR_EXPORT_FIBER_ROOT_POSITIONS | + HAIR_EXPORT_FIBER_VERTEX_COUNTS | + HAIR_EXPORT_FOLLICLE_BINDING | + HAIR_EXPORT_GUIDE_VERTICES | + HAIR_EXPORT_GUIDE_CURVES +} eHairExportCacheUpdateFlags; + +/* Create a new export cache. + * This can be used to construct full fiber data for rendering. + */ struct HairExportCache* BKE_hair_export_cache_new(const struct HairSystem *hsys, int subdiv, struct DerivedMesh *scalp); + +/* Create a new export cache. + * This can be used to construct full fiber data for rendering. + * XXX Mesh-based version for Cycles export, until DerivedMesh->Mesh conversion is done. + */ struct HairExportCache* BKE_hair_export_cache_new_mesh(const struct HairSystem *hsys, int subdiv, struct Mesh *scalp); + +/* Update an existing export cache when data is invalidated. + */ +int BKE_hair_export_cache_update(const struct HairSystem *hsys, int subdiv, struct DerivedMesh *scalp, + struct HairExportCache *cache, int data); + +/* Free the given export cache */ void BKE_hair_export_cache_free(struct HairExportCache *cache); +/* Returns flags for missing data parts */ +int BKE_hair_export_cache_get_required_updates(const struct HairExportCache *cache); + +/* Invalidate all data in a hair export cache */ +void BKE_hair_export_cache_clear(struct HairExportCache *cache); + +/* Invalidate part of the data in a hair export cache */ +void BKE_hair_export_cache_invalidate(struct HairExportCache *cache, int invalidate); + /* === Draw Cache === */ enum { diff --git a/source/blender/blenkernel/intern/hair.c b/source/blender/blenkernel/intern/hair.c index 2b0d95f83ad..999c305e426 100644 --- a/source/blender/blenkernel/intern/hair.c +++ b/source/blender/blenkernel/intern/hair.c @@ -546,102 +546,164 @@ static void hair_guide_calc_vectors(const HairGuideVertex* verts, int numverts, r_tangents[numverts-1], r_normals[numverts-1]); } +/* Create a new export cache. + * This can be used to construct full fiber data for rendering. + */ + HairExportCache* BKE_hair_export_cache_new(const HairSystem *hsys, int subdiv, DerivedMesh *scalp) { HairExportCache *cache = MEM_callocN(sizeof(HairExportCache), "hair export cache"); + + BKE_hair_export_cache_update(hsys, subdiv, scalp, cache, HAIR_EXPORT_ALL); + + return cache; +} - const int totguidecurves = cache->totguidecurves = hsys->guides.totcurves; - cache->guide_curves = MEM_mallocN(sizeof(HairGuideCurve) * totguidecurves, "hair export guide curves"); +/* Create a new export cache. + * This can be used to construct full fiber data for rendering. + * XXX Mesh-based version for Cycles export, until DerivedMesh->Mesh conversion is done. + */ - /* Cache s
[Bf-blender-cvs] [52d6f25d827] hair_guides: Comment on return value.
Commit: 52d6f25d827ad5d7ddc6a173d3e99199187c7eaa Author: Lukas Tönne Date: Fri May 18 16:30:17 2018 +0100 Branches: hair_guides https://developer.blender.org/rB52d6f25d827ad5d7ddc6a173d3e99199187c7eaa Comment on return value. === M source/blender/blenkernel/BKE_hair.h === diff --git a/source/blender/blenkernel/BKE_hair.h b/source/blender/blenkernel/BKE_hair.h index d1ad0f10504..4d3f9e189ef 100644 --- a/source/blender/blenkernel/BKE_hair.h +++ b/source/blender/blenkernel/BKE_hair.h @@ -175,6 +175,7 @@ struct HairExportCache* BKE_hair_export_cache_new(const struct HairSystem *hsys, struct HairExportCache* BKE_hair_export_cache_new_mesh(const struct HairSystem *hsys, int subdiv, struct Mesh *scalp); /* Update an existing export cache when data is invalidated. + * Returns flags for data that has been updated. */ int BKE_hair_export_cache_update(const struct HairSystem *hsys, int subdiv, struct DerivedMesh *scalp, struct HairExportCache *cache, int data); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f9547ab3133] blender2.8: Fix tools not being initialized on startup
Commit: f9547ab3133654f7dac805f9d61c49183fa2046c Author: Campbell Barton Date: Fri May 18 17:32:38 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBf9547ab3133654f7dac805f9d61c49183fa2046c Fix tools not being initialized on startup === M source/blender/editors/screen/workspace_edit.c M source/blender/makesdna/DNA_workspace_types.h M source/blender/windowmanager/WM_api.h M source/blender/windowmanager/intern/wm_toolsystem.c M source/creator/creator.c === diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c index fe52e945399..35d916e403d 100644 --- a/source/blender/editors/screen/workspace_edit.c +++ b/source/blender/editors/screen/workspace_edit.c @@ -202,7 +202,7 @@ bool ED_workspace_change( BLI_assert(CTX_wm_workspace(C) == workspace_new); WM_toolsystem_unlink_all(C, workspace_old); - WM_toolsystem_link_all(C, workspace_new); + WM_toolsystem_reinit_all(C, win); return true; } diff --git a/source/blender/makesdna/DNA_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h index 12dd2d9962a..24fa0e06d90 100644 --- a/source/blender/makesdna/DNA_workspace_types.h +++ b/source/blender/makesdna/DNA_workspace_types.h @@ -71,8 +71,11 @@ typedef struct bToolRef { struct bToolRef *next, *prev; char idname[64]; + /** Use to avoid initializing the same tool multiple times. */ + short tag; + /** bToolKey (spacetype, mode), used in 'WM_api.h' */ - int space_type; + short space_type; /** * Value depends ont the 'space_type', object mode for 3D view, image editor has own mode too. * RNA needs to handle using item function. diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 0d48cd9ef20..e6b045bc249 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -611,14 +611,12 @@ struct bToolRef_Runtime *WM_toolsystem_runtime_from_context(struct bContext *C); struct bToolRef_Runtime *WM_toolsystem_runtime_find(struct WorkSpace *workspace, const bToolKey *tkey); void WM_toolsystem_unlink(struct bContext *C, struct WorkSpace *workspace, const bToolKey *tkey); -void WM_toolsystem_link(struct bContext *C, struct WorkSpace *workspace, const bToolKey *tkey); void WM_toolsystem_refresh(struct bContext *C, struct WorkSpace *workspace, const bToolKey *tkey); void WM_toolsystem_reinit(struct bContext *C, struct WorkSpace *workspace, const bToolKey *tkey); void WM_toolsystem_unlink_all(struct bContext *C, struct WorkSpace *workspace); -void WM_toolsystem_link_all(struct bContext *C, struct WorkSpace *workspace); void WM_toolsystem_refresh_all(struct bContext *C, struct WorkSpace *workspace); -void WM_toolsystem_reinit_all(struct bContext *C, struct WorkSpace *workspace); +void WM_toolsystem_reinit_all(struct bContext *C, struct wmWindow *win); void WM_toolsystem_ref_set_from_runtime( struct bContext *C, struct WorkSpace *workspace, struct bToolRef *tref, diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 122e292985a..3ef5882bc03 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -201,13 +201,6 @@ static void toolsystem_ref_link(bContext *C, WorkSpace *workspace, bToolRef *tre } } } -void WM_toolsystem_link(bContext *C, WorkSpace *workspace, const bToolKey *tkey) -{ - bToolRef *tref = WM_toolsystem_ref_find(workspace, tkey); - if (tref) { - toolsystem_ref_link(C, workspace, tref); - } -} static void toolsystem_refresh_ref(bContext *C, WorkSpace *workspace, bToolRef *tref) { @@ -241,30 +234,42 @@ void WM_toolsystem_reinit(bContext *C, WorkSpace *workspace, const bToolKey *tke void WM_toolsystem_unlink_all(struct bContext *C, struct WorkSpace *workspace) { LISTBASE_FOREACH (bToolRef *, tref, &workspace->tools) { - if (tref->runtime) { - toolsystem_unlink_ref(C, workspace, tref); - } + tref->tag = 0; } -} -void WM_toolsystem_link_all(struct bContext *C, struct WorkSpace *workspace) -{ + LISTBASE_FOREACH (bToolRef *, tref, &workspace->tools) { if (tref->runtime) { - toolsystem_ref_link(C, workspace, tref); + if (tref->tag == 0) { + toolsystem_unlink_ref(C, workspace, tref); + tref->tag = 1; + } } } } + void WM_toolsystem_refresh_all(struct bContext *C, struct W
[Bf-blender-cvs] [c2d5411cbfe] blender2.8: Fix manipulator removal
Commit: c2d5411cbfe2da4b4a274a8695cec8a024cad886 Author: Campbell Barton Date: Fri May 18 17:29:43 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBc2d5411cbfe2da4b4a274a8695cec8a024cad886 Fix manipulator removal The flag could be left set, removing the manipulator type again. === M source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c === diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c index da55db9db00..ab8c797df69 100644 --- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c +++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c @@ -1151,6 +1151,7 @@ void WM_manipulatorconfig_update(struct Main *bmain) { wgt_ref_next = wgt_ref->next; if (wgt_ref->type->type_update_flag & WM_MANIPULATORMAPTYPE_UPDATE_REMOVE) { + wgt_ref->type->type_update_flag &= ~WM_MANIPULATORMAPTYPE_UPDATE_REMOVE; WM_manipulatormaptype_group_unlink(NULL, bmain, mmap_type, wgt_ref->type); } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [30673ff3252] blender2.8: Fix crash when collection view layer cannot be found
Commit: 30673ff3252864f6d8a1e96a20d8af7e156c5bc7 Author: Sybren A. Stüvel Date: Fri May 18 17:24:28 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB30673ff3252864f6d8a1e96a20d8af7e156c5bc7 Fix crash when collection view layer cannot be found === M source/blender/blenloader/intern/readfile.c === diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 44aa8a40993..35b699f29b8 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5686,7 +5686,9 @@ static void direct_link_collection(FileData *fd, Collection *collection) if (collection->view_layer != NULL) { collection->view_layer = newdataadr(fd, collection->view_layer); - direct_link_view_layer(fd, collection->view_layer); + if (collection->view_layer != NULL) { + direct_link_view_layer(fd, collection->view_layer); + } } #endif } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [de7635f607e] blender2.8: Fix: Use DEG_get_ctime() for rigidbody sims instead of BKE_scene_frame_get()
Commit: de7635f607e7b53d69f7befe2d07979f9150314e Author: Joshua Leung Date: Fri May 18 18:04:27 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBde7635f607e7b53d69f7befe2d07979f9150314e Fix: Use DEG_get_ctime() for rigidbody sims instead of BKE_scene_frame_get() There are still probably other massive problems to solve (i.e. which copies of data cache/sim gets written/read from for COW eval) that need to be solved before we can get the sims actually running though. === M source/blender/blenkernel/intern/rigidbody.c === diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 5a9b5585efd..28d5cad3da8 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -67,6 +67,7 @@ #include "BKE_scene.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" /* ** */ /* Memory Management */ @@ -1697,7 +1698,7 @@ void BKE_rigidbody_do_simulation(struct Depsgraph *depsgraph, Scene *scene, floa void BKE_rigidbody_rebuild_sim(struct Depsgraph *depsgraph, Scene *scene) { - float ctime = BKE_scene_frame_get(scene); + float ctime = DEG_get_ctime(depsgraph); DEG_debug_print_eval_time(depsgraph, __func__, scene->id.name, scene, ctime); /* rebuild sim data (i.e. after resetting to start of timeline) */ if (BKE_scene_check_rigidbody_active(scene)) { @@ -1708,7 +1709,7 @@ void BKE_rigidbody_rebuild_sim(struct Depsgraph *depsgraph, void BKE_rigidbody_eval_simulation(struct Depsgraph *depsgraph, Scene *scene) { - float ctime = BKE_scene_frame_get(scene); + float ctime = DEG_get_ctime(depsgraph); DEG_debug_print_eval_time(depsgraph, __func__, scene->id.name, scene, ctime); /* evaluate rigidbody sim */ if (BKE_scene_check_rigidbody_active(scene)) { @@ -1721,7 +1722,7 @@ void BKE_rigidbody_object_sync_transforms(struct Depsgraph *depsgraph, Object *ob) { RigidBodyWorld *rbw = scene->rigidbody_world; - float ctime = BKE_scene_frame_get(scene); + float ctime = DEG_get_ctime(depsgraph); DEG_debug_print_eval_time(depsgraph, __func__, ob->id.name, ob, ctime); /* read values pushed into RBO from sim/cache... */ BKE_rigidbody_sync_transforms(rbw, ob, ctime); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ffaf55be94d] blender2.8: Cycles/Eevee tests: add compare.html to see difference between the engines.
Commit: ffaf55be94dc2c16de944ffd5f7803b0caf6671d Author: Brecht Van Lommel Date: Fri May 18 17:52:46 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBffaf55be94dc2c16de944ffd5f7803b0caf6671d Cycles/Eevee tests: add compare.html to see difference between the engines. === M tests/python/cycles_render_tests.py M tests/python/eevee_render_tests.py M tests/python/modules/render_report.py === diff --git a/tests/python/cycles_render_tests.py b/tests/python/cycles_render_tests.py index eb7a1d96d24..63f7dc0a454 100755 --- a/tests/python/cycles_render_tests.py +++ b/tests/python/cycles_render_tests.py @@ -127,6 +127,7 @@ def main(): from modules import render_report report = render_report.Report("Cycles Test Report", output_dir, idiff) report.set_pixelated(True) +report.set_compare_engines('cycles', 'eevee') ok = report.run(test_dir, render_file) sys.exit(not ok) diff --git a/tests/python/eevee_render_tests.py b/tests/python/eevee_render_tests.py index 176bb470e9a..9756f7a1840 100755 --- a/tests/python/eevee_render_tests.py +++ b/tests/python/eevee_render_tests.py @@ -123,6 +123,7 @@ def main(): report = render_report.Report("Eevee Test Report", output_dir, idiff) report.set_pixelated(True) report.set_reference_dir("eevee_renders") +report.set_compare_engines('eevee', 'cycles') ok = report.run(test_dir, render_file) sys.exit(not ok) diff --git a/tests/python/modules/render_report.py b/tests/python/modules/render_report.py index ec54ba4e823..2e7a092b3d8 100755 --- a/tests/python/modules/render_report.py +++ b/tests/python/modules/render_report.py @@ -96,7 +96,9 @@ class Report: 'verbose', 'update', 'failed_tests', -'passed_tests' +'passed_tests', +'compare_tests', +'compare_engines' ) def __init__(self, title, output_dir, idiff): @@ -104,6 +106,7 @@ class Report: self.output_dir = output_dir self.reference_dir = 'reference_renders' self.idiff = idiff +self.compare_engines = None self.pixelated = False self.verbose = os.environ.get("BLENDER_VERBOSE") is not None @@ -115,6 +118,7 @@ class Report: self.failed_tests = "" self.passed_tests = "" +self.compare_tests = "" if not os.path.exists(output_dir): os.makedirs(output_dir) @@ -125,14 +129,20 @@ class Report: def set_reference_dir(self, reference_dir): self.reference_dir = reference_dir +def set_compare_engines(self, engine, other_engine): +self.compare_engines = (engine, other_engine) + def run(self, dirpath, render_cb): # Run tests and output report. dirname = os.path.basename(dirpath) ok = self._run_all_tests(dirname, dirpath, render_cb) -self._write_html(dirname) +self._write_data(dirname) +self._write_html() +if self.compare_engines: +self._write_html(comparison=True) return ok -def _write_html(self, dirname): +def _write_data(self, dirname): # Write intermediate data for single test. outdir = os.path.join(self.output_dir, dirname) if not os.path.exists(outdir): @@ -144,9 +154,18 @@ class Report: filepath = os.path.join(outdir, "passed.data") pathlib.Path(filepath).write_text(self.passed_tests) +if self.compare_engines: +filepath = os.path.join(outdir, "compare.data") +pathlib.Path(filepath).write_text(self.compare_tests) + +def _write_html(self, comparison = False): # Gather intermediate data for all tests. -failed_data = sorted(glob.glob(os.path.join(self.output_dir, "*/failed.data"))) -passed_data = sorted(glob.glob(os.path.join(self.output_dir, "*/passed.data"))) +if comparison: +failed_data = [] +passed_data = sorted(glob.glob(os.path.join(self.output_dir, "*/compare.data"))) +else: +failed_data = sorted(glob.glob(os.path.join(self.output_dir, "*/failed.data"))) +passed_data = sorted(glob.glob(os.path.join(self.output_dir, "*/passed.data"))) failed_tests = "" passed_tests = "" @@ -171,6 +190,13 @@ class Report: else: message = "" +if comparison: +title = "Render Test Compare" +columns_html = "Name%s%s" % self.compare_engines +else: +title = self.title +columns_html = "NameNewReferenceDiff" + html = """ @@ -208,7 +234,7 @@ class Report: -NameNewReferenceDiff +{columns_html} {tests_html} @@ -216,12 +242,14 @@ class Report: -
[Bf-blender-cvs] [8b76fb8c284] greasepencil-object: Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object
Commit: 8b76fb8c2847e411e5c11a6220cee558a7222077 Author: Antonio Vazquez Date: Fri May 18 18:35:38 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB8b76fb8c2847e411e5c11a6220cee558a7222077 Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [577f93c3993] greasepencil-object: Replace CFRA with DEG_get_ctime()
Commit: 577f93c39930e4d8efb291379bca897305ac44b3 Author: Antonio Vazquez Date: Fri May 18 16:40:39 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB577f93c39930e4d8efb291379bca897305ac44b3 Replace CFRA with DEG_get_ctime() The CFRA value is not updated using COW. === M source/blender/editors/gpencil/gpencil_add_monkey.c M source/blender/editors/gpencil/gpencil_brush.c M source/blender/editors/gpencil/gpencil_convert.c M source/blender/editors/gpencil/gpencil_data.c M source/blender/editors/gpencil/gpencil_edit.c M source/blender/editors/gpencil/gpencil_fill.c M source/blender/editors/gpencil/gpencil_interpolate.c M source/blender/editors/gpencil/gpencil_paint.c M source/blender/editors/gpencil/gpencil_primitive.c M source/blender/editors/gpencil/gpencil_select.c === diff --git a/source/blender/editors/gpencil/gpencil_add_monkey.c b/source/blender/editors/gpencil/gpencil_add_monkey.c index 4dfc8493ad6..254fcf54d2e 100644 --- a/source/blender/editors/gpencil/gpencil_add_monkey.c +++ b/source/blender/editors/gpencil/gpencil_add_monkey.c @@ -40,6 +40,9 @@ #include "BKE_main.h" #include "BKE_material.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" + #include "ED_gpencil.h" /* Definition of the most important info from a color */ @@ -1424,6 +1427,8 @@ void ED_gpencil_create_monkey(bContext *C, float mat[4][4]) Scene *scene = CTX_data_scene(C); Main *bmain = CTX_data_main(C); Object *ob = CTX_data_active_object(C); + Depsgraph *depsgraph = CTX_data_depsgraph(C); + int cfra_eval = (int)DEG_get_ctime(depsgraph); bGPdata *gpd = (bGPdata *)ob->data; bGPDstroke *gps; @@ -1442,8 +1447,8 @@ void ED_gpencil_create_monkey(bContext *C, float mat[4][4]) /* frames */ /* NOTE: No need to check for existing, as this will tkae care of it for us */ - bGPDframe *frameColor = BKE_gpencil_frame_addnew(Colors, CFRA); - bGPDframe *frameLines = BKE_gpencil_frame_addnew(Lines, CFRA); + bGPDframe *frameColor = BKE_gpencil_frame_addnew(Colors, cfra_eval); + bGPDframe *frameLines = BKE_gpencil_frame_addnew(Lines, cfra_eval); /* generate strokes */ gps = BKE_gpencil_add_stroke(frameColor, color_Skin, 538, 3); diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index a432c5d741d..e451fe6d560 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -82,6 +82,7 @@ #include "GPU_immediate_util.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "gpencil_intern.h" @@ -92,6 +93,7 @@ typedef struct tGP_BrushEditData { /* Current editor/region/etc. */ /* NOTE: This stuff is mainly needed to handle 3D view projection stuff... */ + Depsgraph *depsgraph; Scene *scene; Object *object; @@ -1011,7 +1013,10 @@ static void gp_brush_clone_add(bContext *C, tGP_BrushEditData *gso) Scene *scene = gso->scene; Object *ob = CTX_data_active_object(C); bGPDlayer *gpl = CTX_data_active_gpencil_layer(C); - bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, CFRA, true); + Depsgraph *depsgraph = CTX_data_depsgraph(C); + int cfra_eval = (int)DEG_get_ctime(depsgraph); + + bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, cfra_eval, true); bGPDstroke *gps; float delta[3]; @@ -1171,6 +1176,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op) gso = MEM_callocN(sizeof(tGP_BrushEditData), "tGP_BrushEditData"); op->customdata = gso; + gso->depsgraph = CTX_data_depsgraph(C); /* store state */ gso->settings = gpsculpt_get_settings(scene); gso->brush = gpsculpt_get_brush(scene, is_weight_mode); @@ -1333,11 +1339,12 @@ static void gpsculpt_brush_init_stroke(tGP_BrushEditData *gso) { Scene *scene = gso->scene; bGPdata *gpd = gso->gpd; + bGPDlayer *gpl; - int cfra = CFRA; + int cfra_eval = (int)DEG_get_ctime(gso->depsgraph); /* only try to add a new frame if this is the first stroke, or the frame has changed */ - if ((gpd == NULL) || (cfra == gso->cfra)) + if ((gpd == NULL) || (cfra_eval == gso->cfra)) return; /* go through each layer, and ensure that we've got a valid frame to use */ @@ -1351,14 +1358,14 @@ static void gpsculpt_brush_init_stroke(tGP_BrushEditData *gso) * spent too much time editing the wrong frame... */ // XXX: should this be allowed when framelock is enabled? - if (gpf->fr
[Bf-blender-cvs] [8fc732d4190] greasepencil-object: Refactor Brush Setting to new struct
Commit: 8fc732d41908252a758cd936c5cbccb453a554a9 Author: Antonio Vazquez Date: Fri May 18 18:35:26 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB8fc732d41908252a758cd936c5cbccb453a554a9 Refactor Brush Setting to new struct This change moves the settings of grease pencil brush to a new sub struct. WIP: Still not working the brush curves in the UI. The curves are working but don't appear in the UI panel. === M release/scripts/startup/bl_ui/space_view3d_toolbar.py M source/blender/blenkernel/intern/brush.c M source/blender/blenkernel/intern/gpencil.c M source/blender/blenkernel/intern/library_query.c M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/writefile.c M source/blender/editors/gpencil/gpencil_colorpick.c M source/blender/editors/gpencil/gpencil_fill.c M source/blender/editors/gpencil/gpencil_ops.c M source/blender/editors/gpencil/gpencil_paint.c M source/blender/editors/gpencil/gpencil_primitive.c M source/blender/editors/gpencil/gpencil_utils.c M source/blender/editors/interface/interface_icons.c M source/blender/makesdna/DNA_brush_types.h M source/blender/makesdna/DNA_gpencil_types.h M source/blender/makesrna/intern/rna_brush.c === diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index f27e99e5411..fc9077272e8 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1333,56 +1333,58 @@ class VIEW3D_PT_tools_grease_pencil_brush(Panel): col = row.column() brush = context.active_gpencil_brush +gp_settings = brush.gpencil_settings sub = col.column(align=True) sub.operator("gpencil.brush_presets_create", icon='HELP', text="") if brush is not None: # XXX: Items in "sub" currently show up beside the brush selector in a separate column -if brush.gpencil_brush_type == 'ERASE': -sub.prop(brush, "default_eraser", text="") +if gp_settings.gpencil_brush_type == 'ERASE': +sub.prop(gp_settings, "default_eraser", text="") # Brush details -if brush.gpencil_brush_type == 'ERASE': +if gp_settings.gpencil_brush_type == 'ERASE': col = layout.column(align=True) col.prop(brush, "size", text="Radius") col.separator() row = col.row() -row.prop(brush, "eraser_mode", expand=True) -elif brush.gpencil_brush_type == 'FILL': +row.prop(gp_settings, "eraser_mode", expand=True) +elif gp_settings.gpencil_brush_type == 'FILL': col = layout.column(align=True) -col.prop(brush, "gpencil_fill_leak", text="Leak Size") +col.prop(gp_settings, "gpencil_fill_leak", text="Leak Size") col.prop(brush, "size", text="Thickness") -col.prop(brush, "gpencil_fill_simplyfy_level", text="Simplify") +col.prop(gp_settings, "gpencil_fill_simplyfy_level", text="Simplify") + col = layout.row(align=True) -col.template_ID(brush, "material") +col.template_ID(gp_settings, "material") col = layout.column(align=True) col.label(text="Boundary Draw Mode:") row = col.row(align=True) -row.prop(brush, "gpencil_fill_draw_mode", text="") -row.prop(brush, "gpencil_fill_show_boundary", text="", icon='GRID') +row.prop(gp_settings, "gpencil_fill_draw_mode", text="") +row.prop(gp_settings, "gpencil_fill_show_boundary", text="", icon='GRID') col = layout.column(align=True) -col.enabled = brush.gpencil_fill_draw_mode != "STROKE" -col.prop(brush, "gpencil_fill_hide", text="Hide Transparent Lines") +col.enabled = gp_settings.gpencil_fill_draw_mode != "STROKE" +col.prop(gp_settings, "gpencil_fill_hide", text="Hide Transparent Lines") sub = col.row(align=True) -sub.enabled = brush.gpencil_fill_hide -sub.prop(brush, "gpencil_fill_threshold", text="Threshold") -else: # brush.gpencil_brush_type == 'DRAW': +sub.enabled = gp_settings.gpencil_fill_hide +sub.prop(gp_settings, "gpencil_fill_threshold", text="Threshold") +else: # bgpsettings.gpencil_brush_type == 'DRAW': row = layout.row(align=True) row.prop(brush, "size", text="Radius") -row.prop(brush, "use_pressure"
[Bf-blender-cvs] [ca69d500312] greasepencil-object: Cleanup: Check pointer before link
Commit: ca69d5003125ef00090ce7581944310ebc1cbfa6 Author: Antonio Vazquez Date: Fri May 18 18:39:25 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBca69d5003125ef00090ce7581944310ebc1cbfa6 Cleanup: Check pointer before link === M source/blender/blenkernel/intern/library_query.c === diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index c3bb9ae0914..9b1332b1d70 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -751,7 +751,9 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call CALLBACK_INVOKE(brush->toggle_brush, IDWALK_CB_NOP); CALLBACK_INVOKE(brush->clone.image, IDWALK_CB_NOP); CALLBACK_INVOKE(brush->paint_curve, IDWALK_CB_USER); - CALLBACK_INVOKE(brush->gpencil_settings->material, IDWALK_CB_USER); + if (brush->gpencil_settings) { + CALLBACK_INVOKE(brush->gpencil_settings->material, IDWALK_CB_USER); + } library_foreach_mtex(&data, &brush->mtex); library_foreach_mtex(&data, &brush->mask_mtex); break; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2406b8b8d07] greasepencil-object: Verify pointer before assign material
Commit: 2406b8b8d07459475bb71f297892d85767642e1c Author: Antonio Vazquez Date: Fri May 18 18:41:52 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB2406b8b8d07459475bb71f297892d85767642e1c Verify pointer before assign material === M source/blender/blenkernel/intern/gpencil.c === diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 049015a0702..8f2314e1737 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1040,7 +1040,9 @@ Material *BKE_gpencil_get_material_from_brush(Brush *brush) { Material *ma = NULL; - if ((brush != NULL) && (brush->gpencil_settings->material != NULL)) { + if ((brush != NULL) && (brush->gpencil_settings != NULL) && + (brush->gpencil_settings->material != NULL)) + { ma = brush->gpencil_settings->material; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1fd11dd3ba8] blender2.8: Cleanup: comments, use negate_mat3_m4
Commit: 1fd11dd3ba83663939aefc96a435cc0e5b5b68e3 Author: Campbell Barton Date: Fri May 18 19:55:04 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB1fd11dd3ba83663939aefc96a435cc0e5b5b68e3 Cleanup: comments, use negate_mat3_m4 === M source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c M source/blender/editors/mesh/editmesh_add_manipulator.c M source/blender/makesrna/intern/rna_wm_api.c === diff --git a/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c index 770e7716dd2..86c3b4a09de 100644 --- a/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c +++ b/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c @@ -306,7 +306,7 @@ static void MANIPULATOR_WT_button_2d(wmManipulatorType *wt) prop = RNA_def_property(wt->srna, "icon", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_icon_items); - /* Passed to 'GPU_batch_from_poly_2d_encoded' */ + /* Passed to 'GPU_batch_tris_from_poly_2d_encoded' */ RNA_def_property(wt->srna, "shape", PROP_STRING, PROP_BYTESTRING); /* Currently only used for cursor display. */ diff --git a/source/blender/editors/mesh/editmesh_add_manipulator.c b/source/blender/editors/mesh/editmesh_add_manipulator.c index cb531151b84..65e12e673af 100644 --- a/source/blender/editors/mesh/editmesh_add_manipulator.c +++ b/source/blender/editors/mesh/editmesh_add_manipulator.c @@ -189,9 +189,7 @@ static void manipulator_placement_prop_matrix_set( mul_m4_m4m4(mat, man->cage->matrix_basis, value); if (is_negative_m4(mat)) { - negate_v3(mat[0]); - negate_v3(mat[1]); - negate_v3(mat[2]); + negate_mat3_m4(mat); } RNA_property_float_set_array(op->ptr, man->data.prop_matrix, &mat[0][0]); diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index ba955d65ac5..a08a1846c5b 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -572,7 +572,7 @@ void RNA_api_wm(StructRNA *srna) RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_RNAPTR); - /* wrap UI_popover_panel_begin */ + /* wrap UI_popover_begin */ func = RNA_def_function(srna, "popover_begin__internal", "rna_PopoverBegin"); RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT); /* return */ @@ -580,7 +580,7 @@ void RNA_api_wm(StructRNA *srna) RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_RNAPTR); RNA_def_function_return(func, parm); - /* wrap UI_popover_panel_end */ + /* wrap UI_popover_end */ func = RNA_def_function(srna, "popover_end__internal", "rna_PopoverEnd"); RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT); parm = RNA_def_pointer(func, "menu", "UIPopover", "", ""); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [57abe7b1327] tmp-COW_InsertKeyframe_Fix: WIP COW Fix: Insert keyframe operators/api now queries depsgraph for evaluated data
Commit: 57abe7b1327fc67bd23d4d9ae16c77160fc2e0e8 Author: Joshua Leung Date: Fri May 18 20:36:48 2018 +0200 Branches: tmp-COW_InsertKeyframe_Fix https://developer.blender.org/rB57abe7b1327fc67bd23d4d9ae16c77160fc2e0e8 WIP COW Fix: Insert keyframe operators/api now queries depsgraph for evaluated data When using copy on write, insert keyframe operators were reading from old bmain data instead of COW data. This meant that inserting keyframes would often read old/stale data, resulting in invalid keyframes getting created (e.g. from last transform operation, instead of actual current state). This commit makes it so that keyframing operators will ask depsgraph for the evaluated copy of the data, so that it can read values from that. It introduces a new function - `DEG_get_evaluated_rna_pointer()`, which when working correctly/fully, should work just like the other `DEG_get_evaluated_*()` functions, except it lets you pass in an RNA Pointer. However, currently, this is only done for Pose Bones (as a dirty hack, since this is an important/pivotal requirement for production) and/or datablock properties directly (since we can just use the DEG_get_evaluated_id() directly). on the datablock. Committing to a branch for now as this all needs more testing. More work to come later at a more sane time of day! === M source/blender/depsgraph/DEG_depsgraph_query.h M source/blender/depsgraph/intern/depsgraph_query.cc M source/blender/editors/animation/anim_channels_defines.c M source/blender/editors/animation/anim_filter.c M source/blender/editors/animation/keyframing.c M source/blender/editors/animation/keyingsets.c M source/blender/editors/armature/pose_utils.c M source/blender/editors/gpencil/gpencil_convert.c M source/blender/editors/include/ED_anim_api.h M source/blender/editors/include/ED_keyframing.h M source/blender/editors/interface/interface_anim.c M source/blender/editors/space_action/action_edit.c M source/blender/editors/space_graph/graph_edit.c M source/blender/editors/transform/transform_conversions.c M source/blender/python/intern/bpy_rna_anim.c === diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h b/source/blender/depsgraph/DEG_depsgraph_query.h index 6d21c143877..e77bf62bab6 100644 --- a/source/blender/depsgraph/DEG_depsgraph_query.h +++ b/source/blender/depsgraph/DEG_depsgraph_query.h @@ -85,6 +85,10 @@ struct Object *DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct ID *DEG_get_evaluated_id(const struct Depsgraph *depsgraph, struct ID *id); +/* Get evaluated version of data pointed to by RNA pointer */ +void DEG_get_evaluated_rna_pointer(const struct Depsgraph *depsgraph, + const struct PointerRNA *ptr, + struct PointerRNA *r_ptr_eval); /* Get original version of object for given evaluated one. */ struct Object *DEG_get_original_object(struct Object *object); diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc index fea28736627..167e9e0e7d2 100644 --- a/source/blender/depsgraph/intern/depsgraph_query.cc +++ b/source/blender/depsgraph/intern/depsgraph_query.cc @@ -33,15 +33,21 @@ #include "MEM_guardedalloc.h" extern "C" { +#include // XXX: memcpy + #include "BLI_utildefines.h" #include "BKE_idcode.h" #include "BKE_main.h" #include "BLI_listbase.h" + +#include "BKE_action.h" // XXX: BKE_pose_channel_from_name } /* extern "C" */ #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "RNA_access.h" + #include "DEG_depsgraph.h" #include "DEG_depsgraph_query.h" @@ -152,6 +158,39 @@ ID *DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id) return id_node->id_cow; } +/* Get evaluated version of data pointed to by RNA pointer */ +void DEG_get_evaluated_rna_pointer(const Depsgraph *depsgraph, const PointerRNA *ptr, PointerRNA *r_ptr_eval) +{ + if ((ptr == NULL) || (r_ptr_eval == NULL)) { + return; + } + if ((ptr->id.data == ptr->data)) { + ID *orig_id = (ID *)ptr->id.data; + ID *cow_id = DEG_get_evaluated_id(depsgraph, orig_id); + /* For ID pointers, it's easy... */ + r_ptr_eval->id.data = (void *)cow_id; + r_ptr_eval->data = (void *)cow_id; + r_ptr_eval->type = ptr->type; + } + else { + /* XXX: Hack for common cases... Proper fix needs to be made still... A very tricky problem though! */ + if (ptr->type == &RNA_PoseBone) { + const Object *ob_eval = (Object *)DEG_get_evaluated_id(depsgraph, (ID *)ptr->id.data); + bPoseChannel *pchan = (bPoseCh
[Bf-blender-cvs] [e7d2a4718d5] blender2.8: Fix popover args when called from Python
Commit: e7d2a4718d5e9a8e55af3003f90e2eb480b178bc Author: Campbell Barton Date: Fri May 18 21:00:16 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBe7d2a4718d5e9a8e55af3003f90e2eb480b178bc Fix popover args when called from Python === M release/scripts/modules/bpy_types.py === diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index fd6f8e23727..04bb6495ece 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -144,9 +144,9 @@ class WindowManager(bpy_types.ID): finally: self.popmenu_end__internal(popup) -def popover(self, draw_func, title="", icon='NONE'): +def popover(self, draw_func): import bpy -popup = self.popover_begin__internal(title, icon) +popup = self.popover_begin__internal() try: draw_func(popup, bpy.context) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a0b03d3fb2d] blender2.8: Tool System: use classmethod for drawing
Commit: a0b03d3fb2d565a78780fea7c3c801dc50a4425d Author: Campbell Barton Date: Fri May 18 21:16:57 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBa0b03d3fb2d565a78780fea7c3c801dc50a4425d Tool System: use classmethod for drawing Allows the toolbar to be included in a popup. === M release/scripts/startup/bl_ui/space_toolsystem_common.py === diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index d752cad8dfa..a8d1ef02003 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -430,7 +430,11 @@ class ToolSelectPanelHelper: return ui_gen, show_text -def draw(self, context): + +@classmethod +def draw_cls(cls, layout, context): +# Use a classmethod so it can be called outside of a panel context. + # XXX, this UI isn't very nice. # We might need to create new button types for this. # Since we probably want: @@ -443,12 +447,12 @@ class ToolSelectPanelHelper: "name", None, ) -ui_gen, show_text = self._layout_generator_detect_from_region(self.layout, context.region) +ui_gen, show_text = cls._layout_generator_detect_from_region(layout, context.region) # Start iteration ui_gen.send(None) -for item in self.tools_from_context(context): +for item in cls.tools_from_context(context): if item is None: ui_gen.send(True) continue @@ -467,9 +471,9 @@ class ToolSelectPanelHelper: if is_active: # not ideal, write this every time :S -self._tool_group_active[item[0].text] = index +cls._tool_group_active[item[0].text] = index else: -index = self._tool_group_active.get(item[0].text, 0) +index = cls._tool_group_active.get(item[0].text, 0) item = item[index] use_menu = True @@ -500,6 +504,9 @@ class ToolSelectPanelHelper: # Signal to finish any remaining layout edits. ui_gen.send(None) +def draw(self, context): +self.draw_cls(self.layout, context) + @staticmethod def draw_active_tool_header(context, layout): # BAD DESIGN WARNING: last used tool ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4df99bd6013] blender2.8: Ruler: Fix mixed snap.
Commit: 4df99bd60134066c04911c6865c72b262783bc10 Author: Germano Date: Fri May 18 17:12:20 2018 -0300 Branches: blender2.8 https://developer.blender.org/rB4df99bd60134066c04911c6865c72b262783bc10 Ruler: Fix mixed snap. === M source/blender/editors/transform/transform_snap_object.c === diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index 26288b162f7..e5397790cf8 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -2242,8 +2242,6 @@ static short snapObjectsRay( float r_loc[3], float r_no[3], int *r_index, Object **r_ob, float r_obmat[4][4]) { - float original_dist_px = *dist_px; - struct SnapObjUserData data = { .snapdata = snapdata, .dist_px = dist_px, @@ -2257,15 +2255,6 @@ static short snapObjectsRay( iter_snap_objects(sctx, params, sanp_obj_cb, &data); - if ((data.ret == SCE_SELECT_EDGE) && - (snapdata->snap_to_flag & SCE_SELECT_VERTEX)) - { - data.ret = snap_mesh_edge_verts_mixed( - sctx, snapdata, - *r_ob, r_obmat, original_dist_px, - dist_px, r_loc, r_no, r_index); - } - return data.ret; } @@ -2459,19 +2448,15 @@ static short transform_snap_context_project_view3d_mixed_impl( float r_loc[3], float r_no[3], int *r_index, Object **r_ob, float r_obmat[4][4]) { - short retval = 0; - BLI_assert(snap_to_flag != 0); BLI_assert((snap_to_flag & ~(1 | 2 | 4)) == 0); + short retval = 0; + int index = -1; + float loc[3], no[3], obmat[4][4]; Object *ob = NULL; - int index_fallback; - if (r_index == NULL) { - r_index = &index_fallback; - } - const ARegion *ar = sctx->v3d_data.ar; const RegionView3D *rv3d = ar->regiondata; @@ -2492,7 +2477,7 @@ static short transform_snap_context_project_view3d_mixed_impl( sctx, params, ray_start, ray_normal, &dummy_ray_depth, loc, no, - r_index, &ob, obmat, NULL) ? SCE_SELECT_FACE : 0; + &index, &ob, obmat, NULL) ? SCE_SELECT_FACE : 0; } if (snap_to_flag & (SCE_SELECT_VERTEX | SCE_SELECT_EDGE)) { @@ -2522,7 +2507,7 @@ static short transform_snap_context_project_view3d_mixed_impl( /* Try to snap only to the polygon. */ elem = snap_mesh_polygon( sctx, &snapdata, ob, obmat, - &dist_px_tmp, loc, no, r_index); + &dist_px_tmp, loc, no, &index); if (elem) { retval = elem; @@ -2538,12 +2523,21 @@ static short transform_snap_context_project_view3d_mixed_impl( elem = snapObjectsRay( sctx, &snapdata, params, - &dist_px_tmp, loc, no, r_index, &ob, obmat); + &dist_px_tmp, loc, no, &index, &ob, obmat); if (elem) { retval = elem; } + if ((retval == SCE_SELECT_EDGE) && + (snapdata.snap_to_flag & SCE_SELECT_VERTEX)) + { + retval = snap_mesh_edge_verts_mixed( + sctx, &snapdata, + ob, obmat, *dist_px, + &dist_px_tmp, loc, no, &index); + } + *dist_px = dist_px_tmp; } @@ -2558,6 +2552,9 @@ static short transform_snap_context_project_view3d_mixed_impl( if (r_obmat) { copy_m4_m4(r_obmat, obmat); } + if (r_index) { + *r_index = index; + } return retval; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e785048ef31] blender2.8: Fix snap with occlusion.
Commit: e785048ef31fda682f7aeb457aeaaa3621a28d4a Author: Germano Date: Fri May 18 17:26:22 2018 -0300 Branches: blender2.8 https://developer.blender.org/rBe785048ef31fda682f7aeb457aeaaa3621a28d4a Fix snap with occlusion. === M source/blender/editors/transform/transform_snap_object.c === diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index e5397790cf8..fb49396132a 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -2452,6 +2452,7 @@ static short transform_snap_context_project_view3d_mixed_impl( BLI_assert((snap_to_flag & ~(1 | 2 | 4)) == 0); short retval = 0; + bool has_hit = false; int index = -1; float loc[3], no[3], obmat[4][4]; @@ -2473,11 +2474,15 @@ static short transform_snap_context_project_view3d_mixed_impl( float dummy_ray_depth = BVH_RAYCAST_DIST_MAX; - retval = raycastObjects( + has_hit = raycastObjects( sctx, params, ray_start, ray_normal, &dummy_ray_depth, loc, no, - &index, &ob, obmat, NULL) ? SCE_SELECT_FACE : 0; + &index, &ob, obmat, NULL); + + if (has_hit && (snap_to_flag & SCE_SELECT_FACE)) { + retval = SCE_SELECT_FACE; + } } if (snap_to_flag & (SCE_SELECT_VERTEX | SCE_SELECT_EDGE)) { @@ -2499,7 +2504,7 @@ static short transform_snap_context_project_view3d_mixed_impl( snapdata.clip_plane_len = 2; - if (retval == SCE_SELECT_FACE) { + if (has_hit) { /* Compute the new clip_pane but do not add it yet. */ float new_clipplane[4]; plane_from_point_normal_v3(new_clipplane, loc, no); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ddebf1ea3bc] blender2.8: UI: Add menu to show the toolbar
Commit: ddebf1ea3bcc1e5f5650af89952f63d21acb2de8 Author: Campbell Barton Date: Fri May 18 22:27:59 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBddebf1ea3bcc1e5f5650af89952f63d21acb2de8 UI: Add menu to show the toolbar For people who prefer to keep the toolbar hidden, expose as a menu (currently Shift-Space). === M release/scripts/startup/bl_operators/wm.py M release/scripts/startup/bl_ui/space_toolsystem_common.py M source/blender/editors/screen/screen_ops.c M source/blender/windowmanager/intern/wm_operators.c === diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 970eff34026..2f1cf4dc1db 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -2356,6 +2356,26 @@ class WM_OT_tool_set_by_name(Operator): return {'CANCELLED'} +class WM_OT_toolbar(Operator): +bl_idname = "wm.toolbar" +bl_label = "Toolbar" + +def execute(self, context): + +def draw_menu(popover, context): +from bl_ui.space_toolsystem_common import ToolSelectPanelHelper +space_type = context.space_data.type +cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type) +if cls is None: +self.report({'WARNING'}, "Toolbar not found for {space_type!r}") +return {'CANCELLED'} +cls.draw_cls(popover.layout, context, detect_layout=False) + +wm = context.window_manager +wm.popup_menu(draw_menu) +return {'FINISHED'} + + classes = ( BRUSH_OT_active_index_set, WM_OT_addon_disable, @@ -2411,4 +2431,5 @@ classes = ( WM_OT_owner_enable, WM_OT_url_open, WM_OT_tool_set_by_name, +WM_OT_toolbar, ) diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index a8d1ef02003..e1594dfa8ad 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -432,7 +432,7 @@ class ToolSelectPanelHelper: @classmethod -def draw_cls(cls, layout, context): +def draw_cls(cls, layout, context, detect_layout=True): # Use a classmethod so it can be called outside of a panel context. # XXX, this UI isn't very nice. @@ -447,7 +447,11 @@ class ToolSelectPanelHelper: "name", None, ) -ui_gen, show_text = cls._layout_generator_detect_from_region(layout, context.region) +if detect_layout: +ui_gen, show_text = cls._layout_generator_detect_from_region(layout, context.region) +else: +ui_gen = ToolSelectPanelHelper._layout_generator_single_column(layout) +show_text = True # Start iteration ui_gen.send(None) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index df0466075ef..68c05900520 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4637,7 +4637,10 @@ void ED_keymap_screen(wmKeyConfig *keyconf) RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_screen_set", LEFTARROWKEY, KM_PRESS, KM_CTRL, 0)->ptr, "delta", -1); WM_keymap_add_item(keymap, "SCREEN_OT_screen_full_area", UPARROWKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "SCREEN_OT_screen_full_area", DOWNARROWKEY, KM_PRESS, KM_CTRL, 0); + /* we already have two keys for this, disabled for use by WM_OT_toolbar */ +#if 0 WM_keymap_add_item(keymap, "SCREEN_OT_screen_full_area", SPACEKEY, KM_PRESS, KM_SHIFT, 0); +#endif kmi = WM_keymap_add_item(keymap, "SCREEN_OT_screen_full_area", F10KEY, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "use_hide_panels", true); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 3ed5de7b796..70be609dba3 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3959,6 +3959,8 @@ void wm_window_keymap(wmKeyConfig *keyconf) WM_keymap_add_menu(keymap, "USERPREF_MT_ndof_settings", NDOF_BUTTON_MENU, KM_PRESS, 0, 0); #endif + WM_keymap_add_item(keymap, "WM_OT_toolbar", SPACEKEY, KM_PRESS, KM_SHIFT, 0); + /* Space switching */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F3KEY, KM_PRESS, KM_SHIFT, 0); RNA_string_set(kmi->ptr, "data_path", "area.type"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [09bb0bca0f1] soc-2018-hair-shader: Adjusting license information
Commit: 09bb0bca0f1f77f61bdc832a36458bb311134b1c Author: L. E. Segovia Date: Fri May 18 20:32:48 2018 + Branches: soc-2018-hair-shader https://developer.blender.org/rB09bb0bca0f1f77f61bdc832a36458bb311134b1c Adjusting license information Ref T54796 === M intern/cycles/kernel/closure/bsdf_hair_principled.h M source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c === diff --git a/intern/cycles/kernel/closure/bsdf_hair_principled.h b/intern/cycles/kernel/closure/bsdf_hair_principled.h index 1ab99be7a1f..c4b4de7ad46 100644 --- a/intern/cycles/kernel/closure/bsdf_hair_principled.h +++ b/intern/cycles/kernel/closure/bsdf_hair_principled.h @@ -1,33 +1,17 @@ /* - * Adapted from Open Shading Language with this license: + * Copyright 2018 Blender Foundation * - * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. - * All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Modifications Copyright 2011, Blender Foundation. + * http://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Sony Pictures Imageworks nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifdef __KERNEL_CPU__ diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c index 79c8c5b5911..cf5872c3a1e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c @@ -15,12 +15,12 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * The Original Code is Copyright (C) 2005 Blender Foundation. + * The Original Code is Copyright (C) 2018 Blender Foundation. * All rights reserved. * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Lukas Stockner, L. E. Segovia * * * END GPL LICENSE BLOCK * */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [671797e22e1] blender2.8: Correct last commit
Commit: 671797e22e1a5d2cb9f7df9d30012d8a38962ad2 Author: Campbell Barton Date: Fri May 18 23:14:56 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB671797e22e1a5d2cb9f7df9d30012d8a38962ad2 Correct last commit === M release/scripts/startup/bl_operators/wm.py === diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 2f1cf4dc1db..3e2e31e1ef1 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -2361,14 +2361,14 @@ class WM_OT_toolbar(Operator): bl_label = "Toolbar" def execute(self, context): +space_type = context.space_data.type +from bl_ui.space_toolsystem_common import ToolSelectPanelHelper +cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type) +if cls is None: +self.report({'WARNING'}, "Toolbar not found for {space_type!r}") +return {'CANCELLED'} def draw_menu(popover, context): -from bl_ui.space_toolsystem_common import ToolSelectPanelHelper -space_type = context.space_data.type -cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type) -if cls is None: -self.report({'WARNING'}, "Toolbar not found for {space_type!r}") -return {'CANCELLED'} cls.draw_cls(popover.layout, context, detect_layout=False) wm = context.window_manager ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [04d40de354e] soc-2018-hair-shader: Rename possible hair parametrizations
Commit: 04d40de354eb8a07f840fa168bbb3d375adcf40d Author: L. E. Segovia Date: Sat May 19 00:45:20 2018 + Branches: soc-2018-hair-shader https://developer.blender.org/rB04d40de354eb8a07f840fa168bbb3d375adcf40d Rename possible hair parametrizations With this change, I think they're clearer and better follow Pharr's book. Also change default to direct coloring. Ref T54796 === M intern/cycles/blender/blender_shader.cpp M intern/cycles/kernel/svm/svm_closure.h M intern/cycles/kernel/svm/svm_types.h M intern/cycles/render/nodes.cpp M source/blender/makesdna/DNA_node_types.h M source/blender/makesrna/intern/rna_nodetree.c === diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index 5bf4a4c406b..fc8a2159991 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -41,8 +41,8 @@ typedef map ProxyMap; /* Find */ void BlenderSync::find_shader(BL::ID& id, - vector& used_shaders, - Shader *default_shader) + vector& used_shaders, + Shader *default_shader) { Shader *shader = (id)? shader_map.find(id): default_shader; @@ -55,25 +55,25 @@ void BlenderSync::find_shader(BL::ID& id, static VolumeSampling get_volume_sampling(PointerRNA& ptr) { return (VolumeSampling)get_enum(ptr, - "volume_sampling", - VOLUME_NUM_SAMPLING, - VOLUME_SAMPLING_DISTANCE); + "volume_sampling", + VOLUME_NUM_SAMPLING, + VOLUME_SAMPLING_DISTANCE); } static VolumeInterpolation get_volume_interpolation(PointerRNA& ptr) { return (VolumeInterpolation)get_enum(ptr, -"volume_interpolation", -VOLUME_NUM_INTERPOLATION, -VOLUME_INTERPOLATION_LINEAR); + "volume_interpolation", + VOLUME_NUM_INTERPOLATION, + VOLUME_INTERPOLATION_LINEAR); } static DisplacementMethod get_displacement_method(PointerRNA& ptr) { return (DisplacementMethod)get_enum(ptr, - "displacement_method", - DISPLACE_NUM_METHODS, - DISPLACE_BUMP); + "displacement_method", + DISPLACE_NUM_METHODS, + DISPLACE_BUMP); } static int validate_enum_value(int value, int num_values, int default_value) @@ -89,8 +89,8 @@ static InterpolationType get_image_interpolation(NodeType& b_node) { int value = b_node.interpolation(); return (InterpolationType)validate_enum_value(value, - INTERPOLATION_NUM_TYPES, - INTERPOLATION_LINEAR); + INTERPOLATION_NUM_TYPES, + INTERPOLATION_LINEAR); } template @@ -98,8 +98,8 @@ static ExtensionType get_image_extension(NodeType& b_node) { int value = b_node.extension(); return (ExtensionType)validate_enum_value(value, - EXTENSION_NUM_TYPES, - EXTENSION_REPEAT); + EXTENSION_NUM_TYPES, + EXTENSION_REPEAT); } /* Graph */ @@ -161,9 +161,9 @@ static SocketType::Type convert_socket_type(BL::NodeSocket& b_socket) } static void set_default_value(ShaderInput *input, - BL::NodeSocket& b_sock, - BL::BlendData& b_data, - BL::ID& b_id) +
[Bf-blender-cvs] [e3b30fb7ec3] soc-2018-hair-shader: Sync default shader values
Commit: e3b30fb7ec3e3c3fdf2e70db194659e126c9ff9b Author: L. E. Segovia Date: Sat May 19 00:38:48 2018 + Branches: soc-2018-hair-shader https://developer.blender.org/rBe3b30fb7ec3e3c3fdf2e70db194659e126c9ff9b Sync default shader values Ref T54796 === M source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c === diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c index cf5872c3a1e..6c5168c1871 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c @@ -32,8 +32,8 @@ static bNodeSocketTemplate sh_node_bsdf_hair_principled_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Offset"),0.0f, 0.0f, 0.0f, 0.0f, -M_PI_2, M_PI_2, PROP_ANGLE}, - { SOCK_FLOAT, 1, N_("RoughnessU"),0.1f, 0.1f, 0.1f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, - { SOCK_FLOAT, 1, N_("RoughnessV"),1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("RoughnessU"),0.2f, 0.2f, 0.2f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("RoughnessV"),0.2f, 0.2f, 0.2f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_FLOAT, 1, N_("IOR"), 1.55f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, { -1, 0, "" }, }; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [14f881dbacf] soc-2018-hair-shader: Change comment wrt. node numbering
Commit: 14f881dbacffd6a5f5fb6b4957f22b497efb6bf8 Author: L. E. Segovia Date: Sat May 19 00:47:27 2018 + Branches: soc-2018-hair-shader https://developer.blender.org/rB14f881dbacffd6a5f5fb6b4957f22b497efb6bf8 Change comment wrt. node numbering Ref T54796 === M source/blender/blenkernel/BKE_node.h === diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index b75f647b186..9bc2cb2a5fc 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -793,7 +793,7 @@ struct ShadeResult; #define SH_NODE_DISPLACEMENT198 #define SH_NODE_VECTOR_DISPLACEMENT 199 #define SH_NODE_VOLUME_PRINCIPLED 200 -// 201-3xx are occupied --amyspark +// 201..700 occupied by other node types, continue from 701 #define SH_NODE_BSDF_HAIR_PRINCIPLED701 /* custom defines options for Material node */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs