[Bf-blender-cvs] [c5812075569] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Commit: c5812075569f72dd898014504d1ed8beac124e39 Author: Antonioya Date: Thu Jul 26 08:26:41 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBc5812075569f72dd898014504d1ed8beac124e39 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] [e91bdb10e9c] blender2.8: Merge branch 'master' into blender2.8
Commit: e91bdb10e9c11acf98a2e986d490f2de3c272489 Author: Campbell Barton Date: Thu Jul 26 15:51:29 2018 +1000 Branches: blender2.8 https://developer.blender.org/rBe91bdb10e9c11acf98a2e986d490f2de3c272489 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] [44370a307cc] master: UI: hide transform constraints when not used
Commit: 44370a307cc77435880793a6420be143004b34f7 Author: Campbell Barton Date: Thu Jul 26 15:44:27 2018 +1000 Branches: master https://developer.blender.org/rB44370a307cc77435880793a6420be143004b34f7 UI: hide transform constraints when not used === M source/blender/editors/transform/transform.c M source/blender/editors/transform/transform_ops.c === diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index d9e36d0963a..79d06de8b41 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1999,7 +1999,11 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) } } - RNA_property_boolean_set_array(op->ptr, prop, constraint_axis); + /* Only set if needed, so we can hide in the UI when nothing is set. +* See 'transform_poll_property'. */ + if (ELEM(true, UNPACK3(constraint_axis))) { + RNA_property_boolean_set_array(op->ptr, prop, constraint_axis); + } } { diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index f8e23c9744d..df118d7a272 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -499,6 +499,17 @@ static bool transform_poll_property(const bContext *UNUSED(C), wmOperator *op, c { const char *prop_id = RNA_property_identifier(prop); + /* Orientation/Constraints. */ + { + /* Hide orientation axis if no constraints are set, since it wont be used. */ + PropertyRNA *prop_con = RNA_struct_find_property(op->ptr, "constraint_axis"); + if (prop_con && !RNA_property_is_set(op->ptr, prop_con)) { + if (STRPREFIX(prop_id, "constraint")) { + return false; + } + } + } + /* Proportional Editing. */ { PropertyRNA *prop_pet = RNA_struct_find_property(op->ptr, "proportional"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0dd3b200b06] blender2.8: Cleanup: remove redundant flag
Commit: 0dd3b200b06883796ad18bddd53cb97f12c94ee9 Author: Campbell Barton Date: Thu Jul 26 14:58:36 2018 +1000 Branches: blender2.8 https://developer.blender.org/rB0dd3b200b06883796ad18bddd53cb97f12c94ee9 Cleanup: remove redundant flag Caller can pass this flag if necessary. === M source/blender/editors/interface/interface_templates.c === diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index e60c64a971f..131ffbca377 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1557,7 +1557,7 @@ static void template_operator_redo_property_buts_draw( eAutoPropButsReturn return_info = uiTemplateOperatorPropertyButs( C, layout, op, UI_BUT_LABEL_ALIGN_NONE, - layout_flags | (r_has_advanced ? UI_TEMPLATE_OP_PROPS_HIDE_ADVANCED : 0)); + layout_flags); if (return_info & UI_PROP_BUTS_ANY_FAILED_CHECK) { if (r_has_advanced) { *r_has_advanced = true; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9257357c3ff] blender2.8: Merge branch 'master' into blender2.8
Commit: 9257357c3ffa3ed1aeef984535b0a85b594d0f76 Author: Campbell Barton Date: Thu Jul 26 14:49:52 2018 +1000 Branches: blender2.8 https://developer.blender.org/rB9257357c3ffa3ed1aeef984535b0a85b594d0f76 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] [629403fb511] blender2.8: WM: remove duplicate ui-list functions
Commit: 629403fb511089e4545eb6d2248418bf71e0d669 Author: Campbell Barton Date: Thu Jul 26 14:46:33 2018 +1000 Branches: blender2.8 https://developer.blender.org/rB629403fb511089e4545eb6d2248418bf71e0d669 WM: remove duplicate ui-list functions Missed when moving into own file. Caused issues on MSVC, not GCC. === M source/blender/windowmanager/intern/wm.c === diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index f92cc511449..7247529d02d 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -223,65 +223,6 @@ void WM_operator_handlers_clear(wmWindowManager *wm, wmOperatorType *ot) } } -/* uiListType handling ** */ - -static GHash *uilisttypes_hash = NULL; - -uiListType *WM_uilisttype_find(const char *idname, bool quiet) -{ - uiListType *ult; - - if (idname[0]) { - ult = BLI_ghash_lookup(uilisttypes_hash, idname); - if (ult) { - return ult; - } - } - - if (!quiet) { - printf("search for unknown uilisttype %s\n", idname); - } - - return NULL; -} - -bool WM_uilisttype_add(uiListType *ult) -{ - BLI_ghash_insert(uilisttypes_hash, ult->idname, ult); - return 1; -} - -void WM_uilisttype_freelink(uiListType *ult) -{ - bool ok; - - ok = BLI_ghash_remove(uilisttypes_hash, ult->idname, NULL, MEM_freeN); - - BLI_assert(ok); - (void)ok; -} - -/* called on initialize WM_init() */ -void WM_uilisttype_init(void) -{ - uilisttypes_hash = BLI_ghash_str_new_ex("uilisttypes_hash gh", 16); -} - -void WM_uilisttype_free(void) -{ - GHashIterator gh_iter; - - GHASH_ITER (gh_iter, uilisttypes_hash) { - uiListType *ult = BLI_ghashIterator_getValue(&gh_iter); - if (ult->ext.free) { - ult->ext.free(ult->ext.data); - } - } - - BLI_ghash_free(uilisttypes_hash, NULL, MEM_freeN); - uilisttypes_hash = NULL; -} - /* ** */ void WM_keymap_init(bContext *C) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2e12114f3b9] blender2.8: Merge branch 'master' into blender2.8
Commit: 2e12114f3b9f3ac94a0a8fe7a184524f4593ddf9 Author: Campbell Barton Date: Thu Jul 26 13:50:56 2018 +1000 Branches: blender2.8 https://developer.blender.org/rB2e12114f3b9f3ac94a0a8fe7a184524f4593ddf9 Merge branch 'master' into blender2.8 === === diff --cc source/blender/editors/gpencil/gpencil_convert.c index ccdbcba71f9,d6cb36d7fcd..c97c72e17c5 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@@ -1455,7 -1444,7 +1455,7 @@@ static void gp_convert_ui(bContext *C, RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); /* Main auto-draw call */ - uiDefAutoButsRNA(layout, &ptr, gp_convert_draw_check_prop, UI_BUT_LABEL_ALIGN_NONE, false); - uiDefAutoButsRNA(layout, &ptr, gp_convert_draw_check_prop, NULL, '\0'); ++ uiDefAutoButsRNA(layout, &ptr, gp_convert_draw_check_prop, NULL, '\0', false); } void GPENCIL_OT_convert(wmOperatorType *ot) diff --cc source/blender/editors/include/UI_interface.h index 087e0c4ab7b,f2aad249df3..b4756eaed0f --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@@ -750,30 -702,22 +750,30 @@@ uiBut *uiDefSearchButO_ptr void *arg, int retval, int icon, int maxlen, int x, int y, short width, short height, float a1, float a2, const char *tip); -uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2); -int uiDefAutoButsRNA( +/* For uiDefAutoButsRNA */ +typedef enum { + /* Keep current layout for aligning label with property button. */ + UI_BUT_LABEL_ALIGN_NONE, + /* Align label and property button vertically. */ + UI_BUT_LABEL_ALIGN_COLUMN, + /* Split layout into a column for the label and one for property button. */ + UI_BUT_LABEL_ALIGN_SPLIT_COLUMN, +} eButLabelAlign; + +/* Return info for uiDefAutoButsRNA */ +typedef enum { + /* Returns when no buttons were added */ + UI_PROP_BUTS_NONE_ADDED = (1 << 0), + /* Returned when any property failed the custom check callback (check_prop) */ + UI_PROP_BUTS_ANY_FAILED_CHECK = (1 << 1), +} eAutoPropButsReturn; + +uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2); +eAutoPropButsReturn uiDefAutoButsRNA( uiLayout *layout, struct PointerRNA *ptr, - bool (*check_prop)(struct PointerRNA *, struct PropertyRNA *), + bool (*check_prop)(struct PointerRNA *ptr, struct PropertyRNA *prop, void *user_data), void *user_data, -const char label_align); - -/* Links - * - * Game engine logic brick links. Non-functional currently in 2.5, - * code to handle and draw these is disabled internally. */ - -void UI_but_link_set(struct uiBut *but, void **poin, void ***ppoin, short *tot, int from, int to); - -void UI_block_links_compose(uiBlock *block); -uiBut *UI_block_links_find_inlink(uiBlock *block, void *poin); +eButLabelAlign label_align, const bool compact); /* use inside searchfunc to add items */ boolUI_search_item_add(uiSearchItems *items, const char *name, void *poin, int iconid); @@@ -926,16 -865,10 +926,17 @@@ void UI_exit(void) #define UI_ITEM_R_NO_BG (1 << 7) #define UI_ITEM_R_IMMEDIATE (1 << 8) #define UI_ITEM_O_DEPRESS (1 << 9) +#define UI_ITEM_R_COMPACT (1 << 10) -/* uiTemplateOperatorPropertyButs flags */ -#define UI_TEMPLATE_OP_PROPS_SHOW_TITLE 1 -#define UI_TEMPLATE_OP_PROPS_SHOW_EMPTY 2 +#define UI_HEADER_OFFSET ((void)0, 0.2f * UI_UNIT_X) + +/* uiLayoutOperatorButs flags */ +enum { + UI_TEMPLATE_OP_PROPS_SHOW_TITLE = (1 << 0), + UI_TEMPLATE_OP_PROPS_SHOW_EMPTY = (1 << 1), + UI_TEMPLATE_OP_PROPS_COMPACT = (1 << 2), ++ UI_TEMPLATE_OP_PROPS_HIDE_ADVANCED= (1 << 3), +}; /* used for transp checkers */ #define UI_ALPHA_CHECKER_DARK 100 @@@ -1083,11 -990,9 +1084,10 @@@ void uiTemplateImageInfo(uiLayout *layo void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C); void UI_but_func_operator_search(uiBut *but); void uiTemplateOperatorSearch(uiLayout *layout); -void uiTemplateOperatorPropertyButs( +eAutoPropButsReturn uiTemplateOperatorPropertyButs( const struct bContext *C, uiLayout *layout, struct wmOperator *op, - bool (*check_prop)(struct PointerRNA *, struct PropertyRNA *), -const char label_align, const short flag); +const eButLabelAlign label_align, const short flag); +void uiTemplateHeader3D_mode(uiLayout *layout, struct bContext *C); void uiTemplateHeader3D(uiLayout *layout, struct bContext *C); void uiTemplateEdi
[Bf-blender-cvs] [dbd79c097c1] master: WM: Add operator property poll callback
Commit: dbd79c097c14d486fe79b91b916a9f854587b27e Author: Campbell Barton Date: Thu Jul 26 09:59:56 2018 +1000 Branches: master https://developer.blender.org/rBdbd79c097c14d486fe79b91b916a9f854587b27e WM: Add operator property poll callback This allows operators to filter out properties from the auto-generated draw functions. Some custom draw functions can move to using this. === M source/blender/editors/gpencil/gpencil_convert.c M source/blender/editors/include/UI_interface.h M source/blender/editors/interface/interface_templates.c M source/blender/editors/interface/interface_utils.c M source/blender/editors/mesh/editmesh_tools.c M source/blender/editors/object/object_data_transfer.c M source/blender/editors/object/object_relations.c M source/blender/editors/screen/screendump.c M source/blender/editors/space_clip/clip_toolbar.c M source/blender/editors/space_file/file_panels.c M source/blender/editors/space_image/image_ops.c M source/blender/editors/space_sequencer/sequencer_add.c M source/blender/editors/space_view3d/view3d_toolbar.c M source/blender/windowmanager/WM_types.h M source/blender/windowmanager/intern/wm_operators.c === diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index 0c148710e3e..d6cb36d7fcd 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -1371,7 +1371,7 @@ static int gp_convert_layer_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static bool gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop) +static bool gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop, void *UNUSED(user_data)) { const char *prop_id = RNA_property_identifier(prop); const bool link_strokes = RNA_boolean_get(ptr, "use_link_strokes"); @@ -1444,7 +1444,7 @@ static void gp_convert_ui(bContext *C, wmOperator *op) RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); /* Main auto-draw call */ - uiDefAutoButsRNA(layout, &ptr, gp_convert_draw_check_prop, '\0'); + uiDefAutoButsRNA(layout, &ptr, gp_convert_draw_check_prop, NULL, '\0'); } void GPENCIL_OT_convert(wmOperatorType *ot) diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index eefbeee6336..f2aad249df3 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -703,7 +703,11 @@ uiBut *uiDefSearchButO_ptr( short width, short height, float a1, float a2, const char *tip); uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2); -int uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, bool (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align); + +int uiDefAutoButsRNA( +uiLayout *layout, struct PointerRNA *ptr, +bool (*check_prop)(struct PointerRNA *ptr, struct PropertyRNA *prop, void *user_data), void *user_data, +const char label_align); /* Links * @@ -988,7 +992,6 @@ void UI_but_func_operator_search(uiBut *but); void uiTemplateOperatorSearch(uiLayout *layout); void uiTemplateOperatorPropertyButs( const struct bContext *C, uiLayout *layout, struct wmOperator *op, -bool (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align, const short flag); void uiTemplateHeader3D(uiLayout *layout, struct bContext *C); void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index daee0d3af3f..9d05819dd6a 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -3549,13 +3549,24 @@ static void ui_layout_operator_buts__reset_cb(bContext *UNUSED(C), void *op_pt, } #endif +struct uiTemplateOperatorPropertyPollParam { + const bContext *C; + wmOperator *op; +}; + +static bool ui_layout_operator_buts_poll_property( +struct PointerRNA *UNUSED(ptr), struct PropertyRNA *prop, void *user_data) +{ + struct uiTemplateOperatorPropertyPollParam *params = user_data; + return params->op->type->poll_property(params->C, params->op, prop); +} + /** * Draw Operator property buttons for redoing execution with different settings. * This function does not initialize the layout, functions can be called on the layout before and after. */ void uiTemplateOperatorPropertyButs( const bContext *C, uiLayout *layout, wmOperator *op, -
[Bf-blender-cvs] [e6c54903230] master: UI: hide proportional transform options
Commit: e6c5490323068aad1ab9823f8974dea9ed567df9 Author: Campbell Barton Date: Thu Jul 26 11:13:38 2018 +1000 Branches: master https://developer.blender.org/rBe6c5490323068aad1ab9823f8974dea9ed567df9 UI: hide proportional transform options Adds property poll function to transform. === M source/blender/editors/transform/transform_ops.c === diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 7505a0ba7fe..f8e23c9744d 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -495,6 +495,25 @@ static int transform_invoke(bContext *C, wmOperator *op, const wmEvent *event) } } +static bool transform_poll_property(const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop) +{ + const char *prop_id = RNA_property_identifier(prop); + + /* Proportional Editing. */ + { + PropertyRNA *prop_pet = RNA_struct_find_property(op->ptr, "proportional"); + if (prop_pet && (prop_pet != prop) && + (RNA_property_enum_get(op->ptr, prop_pet) == PROP_EDIT_OFF)) + { + if (STRPREFIX(prop_id, "proportional")) { + return false; + } + } + } + + return true; +} + void Transform_Properties(struct wmOperatorType *ot, int flags) { PropertyRNA *prop; @@ -596,6 +615,7 @@ static void TRANSFORM_OT_translate(struct wmOperatorType *ot) ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_screenactive; + ot->poll_property = transform_poll_property; RNA_def_float_vector_xyz(ot->srna, "value", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); @@ -616,6 +636,7 @@ static void TRANSFORM_OT_resize(struct wmOperatorType *ot) ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_screenactive; + ot->poll_property = transform_poll_property; RNA_def_float_vector(ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); @@ -647,6 +668,7 @@ static void TRANSFORM_OT_skin_resize(struct wmOperatorType *ot) ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = skin_resize_poll; + ot->poll_property = transform_poll_property; RNA_def_float_vector(ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); @@ -667,6 +689,7 @@ static void TRANSFORM_OT_trackball(struct wmOperatorType *ot) ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_screenactive; + ot->poll_property = transform_poll_property; /* Maybe we could use float_vector_xyz here too? */ RNA_def_float_rotation(ot->srna, "value", 2, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX); @@ -688,6 +711,7 @@ static void TRANSFORM_OT_rotate(struct wmOperatorType *ot) ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_screenactive; + ot->poll_property = transform_poll_property; RNA_def_float_rotation(ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2); @@ -712,6 +736,7 @@ static void TRANSFORM_OT_tilt(struct wmOperatorType *ot) ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_editcurve_3d; + ot->poll_property = transform_poll_property; RNA_def_float_rotation(ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2); @@ -732,6 +757,7 @@ static void TRANSFORM_OT_bend(struct wmOperatorType *ot) ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_region_view3d_active; + ot->poll_property = transform_poll_property; RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2); @@ -752,6 +778,7 @@ static void TRANSFORM_OT_shear(struct wmOperatorType *ot) ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_screenactive; + ot->poll_property = transform_poll_property; RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX); @@ -773,6 +800,7 @@ static void TRANSFORM_OT_push_pull(struct wmOperatorType *ot) ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_screenactive; + ot->poll_property = transform_poll_property; RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Distance", "", -FLT
[Bf-blender-cvs] [2df27fa6cf8] master: Cleanup: Use const argument
Commit: 2df27fa6cf85a6b4534302a41d9588b550029b01 Author: Campbell Barton Date: Thu Jul 26 11:07:56 2018 +1000 Branches: master https://developer.blender.org/rB2df27fa6cf85a6b4534302a41d9588b550029b01 Cleanup: Use const argument === M source/blender/makesrna/RNA_access.h M source/blender/makesrna/intern/rna_access.c === diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index ffada6efd02..a026d8e875e 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -800,7 +800,7 @@ bool RNA_struct_bl_idname_ok_or_report(struct ReportList *reports, const char *i /* Property Information */ -const char *RNA_property_identifier(PropertyRNA *prop); +const char *RNA_property_identifier(const PropertyRNA *prop); const char *RNA_property_description(PropertyRNA *prop); PropertyType RNA_property_type(PropertyRNA *prop); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 2a74aedd60a..d805d6138a7 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -952,7 +952,7 @@ bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, const char *identifi /* Property Information */ -const char *RNA_property_identifier(PropertyRNA *prop) +const char *RNA_property_identifier(const PropertyRNA *prop) { return rna_ensure_property_identifier(prop); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1882dfc47c1] blender2.8: UI: More opaque type icons in the Outliner
Commit: 1882dfc47c18c9b715c36eb7a76d01a306a10580 Author: Pablo Vazquez Date: Thu Jul 26 02:42:20 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB1882dfc47c18c9b715c36eb7a76d01a306a10580 UI: More opaque type icons in the Outliner Also always draw the counter of elements-per-type with a dark background regardless of the active status. It being white when active affects readability since the icon background itself is already highlighted. Thanks devtalk forum for feedback. === M source/blender/editors/space_outliner/outliner_draw.c === diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 783a03f3993..e1049d02e37 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1341,16 +1341,9 @@ static void tselem_draw_icon( static void outliner_draw_iconrow_number( const uiFontStyle *fstyle, int offsx, int ys, -const eOLDrawState active, const int num_elements) { - float color[4] = {0.4f, 0.4f, 0.4f, 0.9f}; - copy_v3_fl(color, 0.2f); - if (active != OL_DRAWSEL_NONE) { - copy_v3_fl(color, 0.65f); - color[3] = 1.0f; - } - + float color[4] = {0.0f, 0.0f, 0.0f, 1.0f}; float ufac = 0.25f * UI_UNIT_X; float offset_x = (float) offsx + UI_UNIT_X * 0.35f; @@ -1414,13 +1407,13 @@ static void outliner_draw_iconrow_doit( } /* No inlined icon should be clickable. */ - tselem_draw_icon(block, xmax, (float)*offsx, (float)ys, tselem, te, 0.5f * alpha_fac, false); + tselem_draw_icon(block, xmax, (float)*offsx, (float)ys, tselem, te, 0.8f * alpha_fac, false); te->xs = *offsx; te->ys = ys; te->xend = (short)*offsx + UI_UNIT_X; if (num_elements > 1) { - outliner_draw_iconrow_number(fstyle, *offsx, ys, active, num_elements); + outliner_draw_iconrow_number(fstyle, *offsx, ys, num_elements); } (*offsx) += UI_UNIT_X; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9c0dea213ed] blender2.8: Merge branch 'master' into blender2.8
Commit: 9c0dea213ed55b7a66d454bf16de8a7d6855a596 Author: Bastien Montagne Date: Wed Jul 25 21:12:04 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB9c0dea213ed55b7a66d454bf16de8a7d6855a596 Merge branch 'master' into blender2.8 Conflicts: source/blender/blenkernel/intern/rigidbody.c === === diff --cc source/blender/blenkernel/intern/rigidbody.c index 59847b28785,5d6695e6598..e6b8312734f --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@@ -716,8 -700,36 +716,37 @@@ static void rigidbody_validate_sim_obje /* - */ + static void rigidbody_constraint_init_spring( + RigidBodyCon *rbc, void (*set_spring)(rbConstraint*,int,int), + void (*set_stiffness)(rbConstraint*,int,float), void (*set_damping)(rbConstraint*,int,float) + ) { + set_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->flag & RBC_FLAG_USE_SPRING_X); + set_stiffness(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->spring_stiffness_x); + set_damping(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->spring_damping_x); + + set_spring(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->flag & RBC_FLAG_USE_SPRING_Y); + set_stiffness(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->spring_stiffness_y); + set_damping(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->spring_damping_y); + + set_spring(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->flag & RBC_FLAG_USE_SPRING_Z); + set_stiffness(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->spring_stiffness_z); + set_damping(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->spring_damping_z); + + set_spring(rbc->physics_constraint, RB_LIMIT_ANG_X, rbc->flag & RBC_FLAG_USE_SPRING_ANG_X); + set_stiffness(rbc->physics_constraint, RB_LIMIT_ANG_X, rbc->spring_stiffness_ang_x); + set_damping(rbc->physics_constraint, RB_LIMIT_ANG_X, rbc->spring_damping_ang_x); + + set_spring(rbc->physics_constraint, RB_LIMIT_ANG_Y, rbc->flag & RBC_FLAG_USE_SPRING_ANG_Y); + set_stiffness(rbc->physics_constraint, RB_LIMIT_ANG_Y, rbc->spring_stiffness_ang_y); + set_damping(rbc->physics_constraint, RB_LIMIT_ANG_Y, rbc->spring_damping_ang_y); + + set_spring(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->flag & RBC_FLAG_USE_SPRING_ANG_Z); + set_stiffness(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->spring_stiffness_ang_z); + set_damping(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->spring_damping_ang_z); + } + -static void rigidbody_constraint_set_limits(RigidBodyCon *rbc, void (*set_limits)(rbConstraint*,int,float,float)) +static void rigidbody_constraint_set_limits( +RigidBodyCon *rbc, void (*set_limits)(rbConstraint *, int, float, float)) { if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_X) set_limits(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->limit_lin_x_lower, rbc->limit_lin_x_upper); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [29d1db9ed62] master: Fix T55964: Direction not normalized in isect_ray_aabb_v3_simple()?
Commit: 29d1db9ed6253f68c5452be1f0125ed364d4a954 Author: Bastien Montagne Date: Wed Jul 25 21:05:44 2018 +0200 Branches: master https://developer.blender.org/rB29d1db9ed6253f68c5452be1f0125ed364d4a954 Fix T55964: Direction not normalized in isect_ray_aabb_v3_simple()? RNA API Object.ray_cast would not normalize direction vector before doing first quick bbox intersection test, while using its returned distance value. This could lead to wrong exclusion of object. Thanks to @codemanx for finding that issue. === M source/blender/makesrna/intern/rna_object_api.c === diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 2acda5985e1..376a89c65d1 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -332,8 +332,10 @@ static void rna_Object_ray_cast( /* Test BoundBox first (efficiency) */ BoundBox *bb = BKE_object_boundbox_get(ob); float distmin; - if (!bb || (isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], &distmin, NULL) && distmin <= distance)) { - + normalize_v3(direction); /* Needed for valid distance check from isect_ray_aabb_v3_simple() call. */ + if (!bb || + (isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], &distmin, NULL) && distmin <= distance)) + { BVHTreeFromMesh treeData = {NULL}; /* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */ @@ -346,9 +348,6 @@ static void rna_Object_ray_cast( hit.index = -1; hit.dist = distance; - normalize_v3(direction); - - if (BLI_bvhtree_ray_cast(treeData.tree, origin, direction, 0.0f, &hit, treeData.raycast_callback, &treeData) != -1) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5ba4d059c01] master: Fix (unreported) potential div-by-zero in ray/bbox intersection BLI code.
Commit: 5ba4d059c014a038202b6981a040ba247ff42758 Author: Bastien Montagne Date: Wed Jul 25 21:04:28 2018 +0200 Branches: master https://developer.blender.org/rB5ba4d059c014a038202b6981a040ba247ff42758 Fix (unreported) potential div-by-zero in ray/bbox intersection BLI code. Also added note that direction parameter should be normalized vector in case one intend to use returned distance values. === M source/blender/blenlib/intern/math_geom.c === diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index a48d985faed..61b8f6819cc 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -2475,9 +2475,11 @@ bool isect_ray_aabb_v3( return true; } -/* - * Test a bounding box (AABB) for ray intersection - * assumes the ray is already local to the boundbox space +/** + * Test a bounding box (AABB) for ray intersection. + * Assumes the ray is already local to the boundbox space. + * + * \note: \a direction should be normalized if you intend to use the \a tmin or \a tmax distance results! */ bool isect_ray_aabb_v3_simple( const float orig[3], const float dir[3], @@ -2486,19 +2488,25 @@ bool isect_ray_aabb_v3_simple( { double t[7]; float hit_dist[2]; - t[1] = (double)(bb_min[0] - orig[0]) / dir[0]; - t[2] = (double)(bb_max[0] - orig[0]) / dir[0]; - t[3] = (double)(bb_min[1] - orig[1]) / dir[1]; - t[4] = (double)(bb_max[1] - orig[1]) / dir[1]; - t[5] = (double)(bb_min[2] - orig[2]) / dir[2]; - t[6] = (double)(bb_max[2] - orig[2]) / dir[2]; + const double invdirx = (dir[0] > 1e-35f || dir[0] < -1e-35f) ? 1.0 / (double)dir[0] : DBL_MAX; + const double invdiry = (dir[1] > 1e-35f || dir[1] < -1e-35f) ? 1.0 / (double)dir[1] : DBL_MAX; + const double invdirz = (dir[2] > 1e-35f || dir[2] < -1e-35f) ? 1.0 / (double)dir[2] : DBL_MAX; + t[1] = (double)(bb_min[0] - orig[0]) * invdirx; + t[2] = (double)(bb_max[0] - orig[0]) * invdirx; + t[3] = (double)(bb_min[1] - orig[1]) * invdiry; + t[4] = (double)(bb_max[1] - orig[1]) * invdiry; + t[5] = (double)(bb_min[2] - orig[2]) * invdirz; + t[6] = (double)(bb_max[2] - orig[2]) * invdirz; hit_dist[0] = (float)fmax(fmax(fmin(t[1], t[2]), fmin(t[3], t[4])), fmin(t[5], t[6])); hit_dist[1] = (float)fmin(fmin(fmax(t[1], t[2]), fmax(t[3], t[4])), fmax(t[5], t[6])); - if ((hit_dist[1] < 0 || hit_dist[0] > hit_dist[1])) + if ((hit_dist[1] < 0.0f || hit_dist[0] > hit_dist[1])) { return false; + } else { - if (tmin) *tmin = hit_dist[0]; - if (tmax) *tmax = hit_dist[1]; + if (tmin) + *tmin = hit_dist[0]; + if (tmax) + *tmax = hit_dist[1]; return true; } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [21aefa098f4] soc-2018-hair-shader-fixes: Mode weights must not affect the BSDF's PDF
Commit: 21aefa098f4935597a759e199153e9b55279ff8a Author: L. E. Segovia Date: Wed Jul 25 19:05:45 2018 + Branches: soc-2018-hair-shader-fixes https://developer.blender.org/rB21aefa098f4935597a759e199153e9b55279ff8a Mode weights must not affect the BSDF's PDF === M intern/cycles/kernel/closure/bsdf_hair_principled.h === diff --git a/intern/cycles/kernel/closure/bsdf_hair_principled.h b/intern/cycles/kernel/closure/bsdf_hair_principled.h index 83c4a0eb69a..04b279230a1 100644 --- a/intern/cycles/kernel/closure/bsdf_hair_principled.h +++ b/intern/cycles/kernel/closure/bsdf_hair_principled.h @@ -345,29 +345,34 @@ ccl_device float3 bsdf_principled_hair_eval(KernelGlobals *kg, float4 F; float Mp, Np; + float4 weight; /* Primary specular (R). */ Mp = longitudinal_scattering(angles[0], angles[1], sin_theta_o, cos_theta_o, bsdf->m0_roughness); Np = azimuthal_scattering(phi, 0, bsdf->s, gamma_o, gamma_t); - F = bsdf->extra->r * Ap[0] * Mp * Np; + weight = make_float4(bsdf->extra->r, bsdf->extra->r, bsdf->extra->r, 1.0f); + F = weight * Ap[0] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Transmission (TT). */ Mp = longitudinal_scattering(angles[2], angles[3], sin_theta_o, cos_theta_o, 0.25f*bsdf->v); Np = azimuthal_scattering(phi, 1, bsdf->s, gamma_o, gamma_t); - F += bsdf->extra->tt * Ap[1] * Mp * Np; + weight = make_float4(bsdf->extra->tt, bsdf->extra->tt, bsdf->extra->tt, 1.0f); + F += weight * Ap[1] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Secondary specular (TRT). */ Mp = longitudinal_scattering(angles[4], angles[5], sin_theta_o, cos_theta_o, 4.0f*bsdf->v); Np = azimuthal_scattering(phi, 2, bsdf->s, gamma_o, gamma_t); - F += bsdf->extra->trt * Ap[2] * Mp * Np; + weight = make_float4(bsdf->extra->trt, bsdf->extra->trt, bsdf->extra->trt, 1.0f); + F += weight * Ap[2] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Residual component (TRRT+). */ Mp = longitudinal_scattering(sin_theta_i, cos_theta_i, sin_theta_o, cos_theta_o, 4.0f*bsdf->v); Np = M_1_2PI_F; - F += bsdf->extra->trrt * Ap[3] * Mp * Np; + weight = make_float4(bsdf->extra->trrt, bsdf->extra->trrt, bsdf->extra->trrt, 1.0f); + F += weight * Ap[3] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); *pdf = F.w; @@ -461,29 +466,34 @@ ccl_device int bsdf_principled_hair_sample(KernelGlobals *kg, float4 F; float Mp, Np; + float4 weight; /* Primary specular (R). */ Mp = longitudinal_scattering(angles[0], angles[1], sin_theta_o, cos_theta_o, bsdf->m0_roughness); Np = azimuthal_scattering(phi, 0, bsdf->s, gamma_o, gamma_t); - F = bsdf->extra->r * Ap[0] * Mp * Np; + weight = make_float4(bsdf->extra->r, bsdf->extra->r, bsdf->extra->r, 1.0f); + F = weight * Ap[0] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Transmission (TT). */ Mp = longitudinal_scattering(angles[2], angles[3], sin_theta_o, cos_theta_o, 0.25f*bsdf->v); Np = azimuthal_scattering(phi, 1, bsdf->s, gamma_o, gamma_t); - F += bsdf->extra->tt * Ap[1] * Mp * Np; + weight = make_float4(bsdf->extra->tt, bsdf->extra->tt, bsdf->extra->tt, 1.0f); + F += weight * Ap[1] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Secondary specular (TRT). */ Mp = longitudinal_scattering(angles[4], angles[5], sin_theta_o, cos_theta_o, 4.0f*bsdf->v); Np = azimuthal_scattering(phi, 2, bsdf->s, gamma_o, gamma_t); - F += bsdf->extra->trt * Ap[2] * Mp * Np; + weight = make_float4(bsdf->extra->trt, bsdf->extra->trt, bsdf->extra->trt, 1.0f); + F += weight * Ap[2] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Residual component (TRRT+). */ Mp = longitudinal_scattering(sin_theta_i, cos_theta_i, sin_theta_o, cos_theta_o, 4.0f*bsdf->v); Np = M_1_2PI_F; - F += bsdf->extra->trrt * Ap[3] * Mp * Np; + weight = make_float4(bsdf->extra->trrt, bsdf->extra->trrt, bsdf->extra->trrt, 1.0f); + F += weight * Ap[3] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); *eval = float4_to_float3(F); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7e0de88ce2e] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Commit: 7e0de88ce2e8f506912d94459ee5052173ca3eef Author: Antonio Vazquez Date: Wed Jul 25 20:39:12 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB7e0de88ce2e8f506912d94459ee5052173ca3eef 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] [8c9e6c59863] blender2.8: Fix crash Cycles rendering with --debug-value 256.
Commit: 8c9e6c59863077512e7abfa4fdedbbedfd954a87 Author: Brecht Van Lommel Date: Wed Jul 25 19:15:20 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB8c9e6c59863077512e7abfa4fdedbbedfd954a87 Fix crash Cycles rendering with --debug-value 256. === M intern/cycles/blender/addon/engine.py === diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py index 5c52a8bcce9..60057818e37 100644 --- a/intern/cycles/blender/addon/engine.py +++ b/intern/cycles/blender/addon/engine.py @@ -168,7 +168,7 @@ def reset(engine, data, depsgraph): import bpy if bpy.app.debug_value == 256: -_cycles.debug_flags_update(depsgraph.scene) +_cycles.debug_flags_update(depsgraph.scene.as_pointer()) else: _cycles.debug_flags_reset() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9a40690242d] blender2.8: Fix for holdout / indirect only with collection instances.
Commit: 9a40690242dff4153a48c1da0f0f87a71a020e64 Author: Brecht Van Lommel Date: Wed Jul 25 18:30:26 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB9a40690242dff4153a48c1da0f0f87a71a020e64 Fix for holdout / indirect only with collection instances. === M intern/cycles/blender/blender_object.cpp M source/blender/makesrna/intern/rna_object_api.c === diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 42e2198779e..a1f39d0848f 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -347,7 +347,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph, /* Visibility flags for both parent and child. */ PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles"); bool use_holdout = get_boolean(cobject, "is_holdout") || - b_ob.holdout_get(b_view_layer); + b_parent.holdout_get(b_view_layer); uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY; if(b_parent.ptr.data != b_ob.ptr.data) { @@ -362,7 +362,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph, #endif /* Clear camera visibility for indirect only objects. */ - bool use_indirect_only = b_ob.indirect_only_get(b_view_layer); + bool use_indirect_only = b_parent.indirect_only_get(b_view_layer); if(use_indirect_only) { visibility &= ~PATH_RAY_CAMERA; } diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 44709db9d94..8f8f3176096 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -129,10 +129,10 @@ static bool rna_Object_select_get(Object *ob, bContext *C, ReportList *reports) if (!base) { BKE_reportf(reports, RPT_ERROR, "Object '%s' not in View Layer '%s'!", ob->id.name + 2, view_layer->name); - return -1; + return false; } - return ((base->flag & BASE_SELECTED) != 0) ? 1 : 0; + return ((base->flag & BASE_SELECTED) != 0); } static bool rna_Object_visible_get(Object *ob, bContext *C, ReportList *reports) @@ -142,10 +142,10 @@ static bool rna_Object_visible_get(Object *ob, bContext *C, ReportList *reports) if (!base) { BKE_reportf(reports, RPT_ERROR, "Object '%s' not in View Layer '%s'!", ob->id.name + 2, view_layer->name); - return -1; + return false; } - return ((base->flag & BASE_VISIBLE) != 0) ? 1 : 0; + return ((base->flag & BASE_VISIBLE) != 0); } static bool rna_Object_holdout_get(Object *ob, ReportList *reports, ViewLayer *view_layer) @@ -154,10 +154,10 @@ static bool rna_Object_holdout_get(Object *ob, ReportList *reports, ViewLayer *v if (!base) { BKE_reportf(reports, RPT_ERROR, "Object '%s' not in View Layer '%s'!", ob->id.name + 2, view_layer->name); - return -1; + return false; } - return ((base->flag & BASE_HOLDOUT) != 0) ? 1 : 0; + return ((base->flag & BASE_HOLDOUT) != 0); } static bool rna_Object_indirect_only_get(Object *ob, ReportList *reports, ViewLayer *view_layer) @@ -166,10 +166,10 @@ static bool rna_Object_indirect_only_get(Object *ob, ReportList *reports, ViewLa if (!base) { BKE_reportf(reports, RPT_ERROR, "Object '%s' not in View Layer '%s'!", ob->id.name + 2, view_layer->name); - return -1; + return false; } - return ((base->flag & BASE_INDIRECT_ONLY) != 0) ? 1 : 0; + return ((base->flag & BASE_INDIRECT_ONLY) != 0); } /* Convert a given matrix from a space to another (using the object and/or a bone as reference). */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d250cd950b7] soc-2018-npr: Typo fix finalColor
Commit: d250cd950b7d0fcaae71759e9140e7a1b998d38b Author: Nick Wu Date: Wed Jul 25 22:49:14 2018 +0800 Branches: soc-2018-npr https://developer.blender.org/rBd250cd950b7d0fcaae71759e9140e7a1b998d38b Typo fix finalColor === M source/blender/draw/engines/lanpr/shaders/lanpr_snake_multichannel_frag.glsl === diff --git a/source/blender/draw/engines/lanpr/shaders/lanpr_snake_multichannel_frag.glsl b/source/blender/draw/engines/lanpr/shaders/lanpr_snake_multichannel_frag.glsl index 016f3821ccc..10aa51d1463 100644 --- a/source/blender/draw/engines/lanpr/shaders/lanpr_snake_multichannel_frag.glsl +++ b/source/blender/draw/engines/lanpr/shaders/lanpr_snake_multichannel_frag.glsl @@ -1,5 +1,5 @@ in vec3 normal; -in vec4 finalcolor; +in vec4 finalColor; float Interpolate(float between1,float between2,float value1,float value2,float key){ float i = (key-between1)/(between2-between1); @@ -12,6 +12,6 @@ void main(){ //else if(value>=0.65 && value<0.85) value=Interpolate(0.65,0.85,0.15,0.75,value); //else if(value>=0.85 && value<0.95) value=0.75; //else if(value>=0.95) value=0.9; -gl_FragData[0] = vec4(finalcolor.rgb*value,1); +gl_FragData[0] = vec4(finalColor.rgb*value,1); gl_FragData[1] = vec4(normal,1);//vec4((normal+vec3(1))*0.5,1); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bd326d0d1fe] blender2.8: UI: Sort panels in mesh context
Commit: bd326d0d1fedf2bcedbb72fb8f14847991e6cce6 Author: Pablo Vazquez Date: Wed Jul 25 16:48:04 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBbd326d0d1fedf2bcedbb72fb8f14847991e6cce6 UI: Sort panels in mesh context Also collapse by default the less frequented Face Maps and Normals === M release/scripts/startup/bl_ui/properties_data_mesh.py === diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 214852cc826..f096ff83957 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -152,6 +152,7 @@ class DATA_PT_context_mesh(MeshButtonsPanel, Panel): class DATA_PT_normals(MeshButtonsPanel, Panel): bl_label = "Normals" +bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'} def draw(self, context): @@ -239,6 +240,7 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel): class DATA_PT_face_maps(MeshButtonsPanel, Panel): bl_label = "Face Maps" +bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'} @classmethod @@ -450,13 +452,13 @@ classes = ( MESH_UL_shape_keys, MESH_UL_uvmaps_vcols, DATA_PT_context_mesh, -DATA_PT_normals, -DATA_PT_texture_space, DATA_PT_vertex_groups, -DATA_PT_face_maps, DATA_PT_shape_keys, DATA_PT_uv_texture, DATA_PT_vertex_colors, +DATA_PT_face_maps, +DATA_PT_normals, +DATA_PT_texture_space, DATA_PT_customdata, DATA_PT_custom_props_mesh, ) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [885cda65c90] blender2.8: Cycles: add per layer collection indirectly on setting.
Commit: 885cda65c90b3f85dc4e72e2e9759aa926a8f07c Author: Brecht Van Lommel Date: Wed Jul 25 12:26:09 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB885cda65c90b3f85dc4e72e2e9759aa926a8f07c Cycles: add per layer collection indirectly on setting. In the outliner, right click > view layer > set indirect only. This is like clearing camera ray visibility on objects in the collection, and is temporary until we have more general dynamic overrides. === M intern/cycles/blender/blender_object.cpp M release/scripts/startup/bl_ui/space_outliner.py M source/blender/blenkernel/intern/layer.c M source/blender/blenloader/intern/versioning_280.c M source/blender/editors/space_outliner/outliner_collections.c M source/blender/editors/space_outliner/outliner_intern.h M source/blender/editors/space_outliner/outliner_ops.c M source/blender/makesdna/DNA_layer_types.h M source/blender/makesrna/intern/rna_layer.c M source/blender/makesrna/intern/rna_object_api.c === diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index fd8790c0c79..42e2198779e 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -361,12 +361,11 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph, } #endif - /* TODO: hide objects not on render layer from camera rays. */ -#if 0 - if(!(layer_flag & view_layer.layer)) { + /* Clear camera visibility for indirect only objects. */ + bool use_indirect_only = b_ob.indirect_only_get(b_view_layer); + if(use_indirect_only) { visibility &= ~PATH_RAY_CAMERA; } -#endif /* Don't export completely invisible objects. */ if(visibility == 0) { diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index 284a49c8789..20ef5ae0c53 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -146,6 +146,9 @@ class OUTLINER_MT_collection_view_layer(Menu): layout.operator("outliner.collection_exclude_clear") if context.engine == 'CYCLES': +layout.operator("outliner.collection_indirect_only_set") +layout.operator("outliner.collection_indirect_only_clear") + layout.operator("outliner.collection_holdout_set") layout.operator("outliner.collection_holdout_clear") diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 73a217b8865..1396ad1f97c 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -715,10 +715,13 @@ static int layer_collection_sync( lc->runtime_flag |= LAYER_COLLECTION_HAS_VISIBLE_OBJECTS; } - /* Holdout */ + /* Holdout and indirect only */ if (lc->flag & LAYER_COLLECTION_HOLDOUT) { base->flag |= BASE_HOLDOUT; } + if (lc->flag & LAYER_COLLECTION_INDIRECT_ONLY) { + base->flag |= BASE_INDIRECT_ONLY; + } lc->runtime_flag |= LAYER_COLLECTION_HAS_OBJECTS; } @@ -760,7 +763,8 @@ void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer) BASE_SELECTABLE | BASE_ENABLED_VIEWPORT | BASE_ENABLED_RENDER | - BASE_HOLDOUT); + BASE_HOLDOUT | + BASE_INDIRECT_ONLY); } view_layer->runtime_flag = 0; diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 94afc41..068c12daa94 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -487,28 +487,15 @@ static void do_version_layers_to_collections(Main *bmain, Scene *scene) nlc->flag |= LAYER_COLLECTION_EXCLUDE; } } - else if ((scene->lay & srl->lay & ~(srl->lay_exclude) & (1 << layer)) || -(srl->lay_zmask & (scene->lay | srl->lay_exclude) & (1 << layer))) - { + else { if (srl->lay_zmask & (1 << layer)) { have_override = true;
[Bf-blender-cvs] [2ab98cca19c] soc-2018-hair-shader-fixes: Add mode controls
Commit: 2ab98cca19cb3acd3da61b5f71a61a1139f1713e Author: L. E. Segovia Date: Wed Jul 25 14:25:41 2018 + Branches: soc-2018-hair-shader-fixes https://developer.blender.org/rB2ab98cca19cb3acd3da61b5f71a61a1139f1713e Add mode controls This is useful only for separating each light mode (R, TT, TRT, TRRT+) and see how the shader behaves in each. === M intern/cycles/kernel/closure/bsdf_hair_principled.h M intern/cycles/kernel/svm/svm_closure.h M intern/cycles/render/graph.cpp M intern/cycles/render/nodes.cpp M intern/cycles/render/nodes.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 6907b5e7f08..83c4a0eb69a 100644 --- a/intern/cycles/kernel/closure/bsdf_hair_principled.h +++ b/intern/cycles/kernel/closure/bsdf_hair_principled.h @@ -32,6 +32,11 @@ typedef ccl_addr_space struct PrincipledHairExtra { float eta; /* Geometry data. */ float4 geom; + + float r; + float tt; + float trt; + float trrt; } PrincipledHairExtra; typedef ccl_addr_space struct PrincipledHairBSDF { @@ -344,25 +349,25 @@ ccl_device float3 bsdf_principled_hair_eval(KernelGlobals *kg, /* Primary specular (R). */ Mp = longitudinal_scattering(angles[0], angles[1], sin_theta_o, cos_theta_o, bsdf->m0_roughness); Np = azimuthal_scattering(phi, 0, bsdf->s, gamma_o, gamma_t); - F = Ap[0] * Mp * Np; + F = bsdf->extra->r * Ap[0] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Transmission (TT). */ Mp = longitudinal_scattering(angles[2], angles[3], sin_theta_o, cos_theta_o, 0.25f*bsdf->v); Np = azimuthal_scattering(phi, 1, bsdf->s, gamma_o, gamma_t); - F += Ap[1] * Mp * Np; + F += bsdf->extra->tt * Ap[1] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Secondary specular (TRT). */ Mp = longitudinal_scattering(angles[4], angles[5], sin_theta_o, cos_theta_o, 4.0f*bsdf->v); Np = azimuthal_scattering(phi, 2, bsdf->s, gamma_o, gamma_t); - F += Ap[2] * Mp * Np; + F += bsdf->extra->trt * Ap[2] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Residual component (TRRT+). */ Mp = longitudinal_scattering(sin_theta_i, cos_theta_i, sin_theta_o, cos_theta_o, 4.0f*bsdf->v); Np = M_1_2PI_F; - F += Ap[3] * Mp * Np; + F += bsdf->extra->trrt * Ap[3] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); *pdf = F.w; @@ -460,25 +465,25 @@ ccl_device int bsdf_principled_hair_sample(KernelGlobals *kg, /* Primary specular (R). */ Mp = longitudinal_scattering(angles[0], angles[1], sin_theta_o, cos_theta_o, bsdf->m0_roughness); Np = azimuthal_scattering(phi, 0, bsdf->s, gamma_o, gamma_t); - F = Ap[0] * Mp * Np; + F = bsdf->extra->r * Ap[0] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Transmission (TT). */ Mp = longitudinal_scattering(angles[2], angles[3], sin_theta_o, cos_theta_o, 0.25f*bsdf->v); Np = azimuthal_scattering(phi, 1, bsdf->s, gamma_o, gamma_t); - F += Ap[1] * Mp * Np; + F += bsdf->extra->tt * Ap[1] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Secondary specular (TRT). */ Mp = longitudinal_scattering(angles[4], angles[5], sin_theta_o, cos_theta_o, 4.0f*bsdf->v); Np = azimuthal_scattering(phi, 2, bsdf->s, gamma_o, gamma_t); - F += Ap[2] * Mp * Np; + F += bsdf->extra->trt * Ap[2] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); /* Residual component (TRRT+). */ Mp = longitudinal_scattering(sin_theta_i, cos_theta_i, sin_theta_o, cos_theta_o, 4.0f*bsdf->v); Np = M_1_2PI_F; - F += Ap[3] * Mp * Np; + F += bsdf->extra->trrt * Ap[3] * Mp * Np; kernel_assert(isfinite3_safe(float4_to_float3(F))); *eval = float4_to_float3(F); diff --git a/intern/cycles/kernel/svm/svm_closure.h b/intern/cycles/kernel/svm/svm_closure.h index 6b2910df67a..85c7e93f246 100644 --- a/intern/cycles/kernel/svm/svm_closure.h +++ b/intern/cycles/kernel/svm/svm_closure.h @@ -741,6 +741,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float * uint4 data_node2 = read_node(kg, offset); uint4 data_node3 = read_node(kg, offset); uint4 data_node4 = read_node(kg, offset); + uint4 data_node5 = read_node(kg, offset); float3 weight = sd->svm_closure_weight * mix_weight; @@ -764,6 +765,8 @@ c
[Bf-blender-cvs] [dd5fcd4d0f9] soc-2018-npr: Fix camera access error, added report to no camera situation.
Commit: dd5fcd4d0f9e4da98bf6c46d6a87b2ead0709b4c Author: Nick Wu Date: Wed Jul 25 22:25:18 2018 +0800 Branches: soc-2018-npr https://developer.blender.org/rBdd5fcd4d0f9e4da98bf6c46d6a87b2ead0709b4c Fix camera access error, added report to no camera situation. === M source/blender/draw/engines/lanpr/lanpr_dpix.c M source/blender/draw/engines/lanpr/lanpr_engine.c M source/blender/draw/engines/lanpr/lanpr_ops.c === diff --git a/source/blender/draw/engines/lanpr/lanpr_dpix.c b/source/blender/draw/engines/lanpr/lanpr_dpix.c index d717b7799fc..db9210b3947 100644 --- a/source/blender/draw/engines/lanpr/lanpr_dpix.c +++ b/source/blender/draw/engines/lanpr/lanpr_dpix.c @@ -42,7 +42,7 @@ void lanpr_init_atlas_inputs(void *ved){ const DRWContextState *draw_ctx = DRW_context_state_get(); View3D *v3d = draw_ctx->v3d; RegionView3D *rv3d = draw_ctx->rv3d; - Object *camera = (rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL; + Object *camera = (rv3d && rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL; SceneLANPR *lanpr = &draw_ctx->scene->lanpr; if (lanpr->reloaded || !txl->dpix_in_pl) { @@ -377,11 +377,12 @@ void lanpr_dpix_draw_scene(LANPR_TextureList *txl, LANPR_FramebufferList *fbl, L Object *camera; if (v3d) { RegionView3D *rv3d = draw_ctx->rv3d; - camera = (rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL; + camera = (rv3d && rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL; } - else { + if(!camera){ camera = scene->camera; } + if (!camera) return; pd->dpix_viewport[2] = texw; pd->dpix_viewport[3] = texh; diff --git a/source/blender/draw/engines/lanpr/lanpr_engine.c b/source/blender/draw/engines/lanpr/lanpr_engine.c index 755801b6585..11b7bbf0d0e 100644 --- a/source/blender/draw/engines/lanpr/lanpr_engine.c +++ b/source/blender/draw/engines/lanpr/lanpr_engine.c @@ -59,14 +59,6 @@ static void lanpr_engine_init(void *ved){ Scene *scene = DEG_get_evaluated_scene(draw_ctx->depsgraph); SceneLANPR *lanpr = &scene->lanpr; View3D *v3d = draw_ctx->v3d; - Object *camera; - if (v3d) { - RegionView3D *rv3d = draw_ctx->rv3d; - camera = (rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL; - } - else { - camera = scene->camera; - } if (!OneTime.InitComplete) { //lanpr->depth_clamp = 0.01; @@ -269,14 +261,6 @@ static void lanpr_cache_init(void *vedata){ Scene *scene = DEG_get_evaluated_scene(draw_ctx->depsgraph); SceneLANPR *lanpr = &scene->lanpr; View3D *v3d = draw_ctx->v3d; - Object *camera; - if (v3d) { - RegionView3D *rv3d = draw_ctx->rv3d; - camera = (rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL; - } - else { - camera = scene->camera; - } psl->color_pass = DRW_pass_create("color Pass", DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WRITE_DEPTH); stl->g_data->multipass_shgrp = DRW_shgroup_create(OneTime.multichannel_shader, psl->color_pass); @@ -466,14 +450,6 @@ static void lanpr_draw_scene_exec(void *vedata, GPUFrameBuffer *dfb) { Scene *scene = DEG_get_evaluated_scene(draw_ctx->depsgraph); SceneLANPR *lanpr = &scene->lanpr; View3D *v3d = draw_ctx->v3d; - Object *camera; - if (v3d) { - RegionView3D *rv3d = draw_ctx->rv3d; - camera = (rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL; - } - else { - camera = scene->camera; - } //DEBUG, draw a square only { diff --git a/source/blender/draw/engines/lanpr/lanpr_ops.c b/source/blender/draw/engines/lanpr/lanpr_ops.c index ee594033d95..fef1d451fc7 100644 --- a/source/blender/draw/engines/lanpr/lanpr_ops.c +++ b/source/blender/draw/engines/lanpr/lanpr_ops.c @@ -21,6 +21,7 @@ #include "DEG_depsgraph_query.h" #include "BKE_camera.h" #include "BKE_collection.h" +#include "BKE_report.h" #include "GPU_draw.h" #include "GPU_batch.h" @@ -1687,7 +1688,6 @@ void lanpr_make_render_geometry_buffers(Depsgraph *depsgraph, Scene *s, Object * CollectionObject *co; tnsMatrix44d obmat16; tnsMatrix44d proj, view, result, inv; - if (!c) return; Camera *cam = c->data; float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y); @@ -2994,14 +2994,14 @@ void lanpr_software_draw_scene(void *vedata, GPUFrameBuffer *dfb) { Scene *scene = DEG_get_evaluated_scene(draw_ctx->depsgraph); SceneLANPR *lanpr = &scene->lanpr; View3D *v3d = draw_ctx->v3d; - Object *camera; - if (v3d) { - RegionView
[Bf-blender-cvs] [3353221166b] soc-2018-npr: Fix code for strict compile.
Commit: 3353221166b09083e875b9d3d4b95a523b115e08 Author: Nick Wu Date: Wed Jul 25 22:15:18 2018 +0800 Branches: soc-2018-npr https://developer.blender.org/rB3353221166b09083e875b9d3d4b95a523b115e08 Fix code for strict compile. === M source/blender/draw/engines/lanpr/lanpr_all.h M source/blender/draw/engines/lanpr/lanpr_chain.c M source/blender/draw/engines/lanpr/lanpr_dpix.c M source/blender/draw/engines/lanpr/lanpr_ops.c M source/blender/draw/engines/lanpr/lanpr_util.c M source/blender/draw/engines/lanpr/lanpr_util.h M source/blender/draw/engines/lanpr/shaders/lanpr_snake_line_connection_geom.glsl M source/blender/draw/engines/lanpr/shaders/lanpr_snake_multichannel_frag.glsl === diff --git a/source/blender/draw/engines/lanpr/lanpr_all.h b/source/blender/draw/engines/lanpr/lanpr_all.h index 0ab2c80eccb..330df6aa6de 100644 --- a/source/blender/draw/engines/lanpr/lanpr_all.h +++ b/source/blender/draw/engines/lanpr/lanpr_all.h @@ -573,7 +573,7 @@ extern RenderEngineType DRW_engine_viewport_lanpr_type; #define TNS_IN_TILE(RenderTile, Fx, Fy) \ (TNS_IN_TILE_X(RenderTile, Fx) && TNS_IN_TILE_Y(RenderTile, Fy)) -__inline void tMatConvert44df(tnsMatrix44d from, tnsMatrix44f to) { +BLI_INLINE void tMatConvert44df(tnsMatrix44d from, tnsMatrix44f to) { to[0] = from[0]; to[1] = from[1]; to[2] = from[2]; @@ -592,7 +592,7 @@ __inline void tMatConvert44df(tnsMatrix44d from, tnsMatrix44f to) { to[15] = from[15]; } -__inline int lanpr_TrangleLineBoundBoxTest(LANPR_RenderTriangle *rt, LANPR_RenderLine *rl) { +BLI_INLINE int lanpr_TrangleLineBoundBoxTest(LANPR_RenderTriangle *rt, LANPR_RenderLine *rl) { if (MAX3(rt->V[0]->FrameBufferCoord[2], rt->V[1]->FrameBufferCoord[2], rt->V[2]->FrameBufferCoord[2]) > MIN2(rl->L->FrameBufferCoord[2], rl->R->FrameBufferCoord[2])) return 0; if (MAX3(rt->V[0]->FrameBufferCoord[0], rt->V[1]->FrameBufferCoord[0], rt->V[2]->FrameBufferCoord[0]) < MIN2(rl->L->FrameBufferCoord[0], rl->R->FrameBufferCoord[0])) return 0; if (MIN3(rt->V[0]->FrameBufferCoord[0], rt->V[1]->FrameBufferCoord[0], rt->V[2]->FrameBufferCoord[0]) > MAX2(rl->L->FrameBufferCoord[0], rl->R->FrameBufferCoord[0])) return 0; @@ -601,8 +601,8 @@ __inline int lanpr_TrangleLineBoundBoxTest(LANPR_RenderTriangle *rt, LANPR_Rende return 1; } -__inline double tMatGetLinearRatio(real L, real R, real FromL); -__inline int lanpr_LineIntersectTest2d(tnsVector2d a1, tnsVector2d a2, tnsVector2d b1, tnsVector2d b2, double *aRatio) { +BLI_INLINE double tMatGetLinearRatio(real L, real R, real FromL); +BLI_INLINE int lanpr_LineIntersectTest2d(tnsVector2d a1, tnsVector2d a2, tnsVector2d b1, tnsVector2d b2, double *aRatio) { double k1, k2; double x; double y; @@ -656,96 +656,96 @@ __inline int lanpr_LineIntersectTest2d(tnsVector2d a1, tnsVector2d a2, tnsVector return 1; } -__inline double lanpr_GetLineZ(tnsVector3d L, tnsVector3d R, real Ratio) { +BLI_INLINE double lanpr_GetLineZ(tnsVector3d L, tnsVector3d R, real Ratio) { //double z = 1 / tnsLinearItp(1 / L[2], 1 / R[2], Ratio); double z = tnsLinearItp(L[2], R[2], Ratio); return z; } -__inline double lanpr_GetLineZPoint(tnsVector3d L, tnsVector3d R, tnsVector3d FromL) { +BLI_INLINE double lanpr_GetLineZPoint(tnsVector3d L, tnsVector3d R, tnsVector3d FromL) { double r = (FromL[0] - L[0]) / (R[0] - L[0]); return tnsLinearItp(L[2], R[2], r); //return 1 / tnsLinearItp(1 / L[2], 1 / R[2], r); } -__inline double lanpr_GetLinearRatio(tnsVector3d L, tnsVector3d R, tnsVector3d FromL) { +BLI_INLINE double lanpr_GetLinearRatio(tnsVector3d L, tnsVector3d R, tnsVector3d FromL) { double r = (FromL[0] - L[0]) / (R[0] - L[0]); return r; } -__inline double tMatGetLinearRatio(real L, real R, real FromL) { +BLI_INLINE double tMatGetLinearRatio(real L, real R, real FromL) { double r = (FromL - L) / (R - L); return r; } -__inline void tMatVectorMinus2d(tnsVector2d result, tnsVector2d l, tnsVector2d r) { +BLI_INLINE void tMatVectorMinus2d(tnsVector2d result, tnsVector2d l, tnsVector2d r) { result[0] = l[0] - r[0]; result[1] = l[1] - r[1]; } -__inline void tMatVectorMinus3d(tnsVector3d result, tnsVector3d l, tnsVector3d r) { +BLI_INLINE void tMatVectorMinus3d(tnsVector3d result, tnsVector3d l, tnsVector3d r) { result[0] = l[0] - r[0]; result[1] = l[1] - r[1]; result[2] = l[2] - r[2]; } -__inline void tMatVectorSubtract3d(tnsVector3d l, tnsVector3d r) { +BLI_INLINE void tMatVectorSubtract3d(tnsVector3d l, tnsVector3d r) { l[0] = l[0] - r[0]; l[1] = l[1] - r[1]; l[2] = l[2] - r[2]; } -__inline void tMatVectorPlus3d(tnsVector3d result, tnsVector3d l, tns
[Bf-blender-cvs] [e6e8ee2922c] blender2.8: UI: Single column and subpanels for Particles Physics Fluids and Boids
Commit: e6e8ee2922c023971c11a566cba8085c3dd70e76 Author: William Reynish Date: Wed Jul 25 16:12:04 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBe6e8ee2922c023971c11a566cba8085c3dd70e76 UI: Single column and subpanels for Particles Physics Fluids and Boids === M release/scripts/startup/bl_ui/properties_particle.py === diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 9d891a07989..75b2d76d9c4 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -662,164 +662,336 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): if part.physics_type == 'FLUID': fluid = part.fluid -col.label(text="Fluid") +col.separator() col.prop(fluid, "solver") col.prop(fluid, "stiffness", text="Stiffness") col.prop(fluid, "linear_viscosity", text="Viscosity") col.prop(fluid, "buoyancy", text="Buoyancy", slider=True) -col.label(text="Advanced") +elif part.physics_type == 'KEYED': + +sub = col.column() +sub.active = not psys.use_keyed_timing +sub.prop(part, "keyed_loops", text="Loops") +if psys: +col.prop(psys, "use_keyed_timing", text="Use Timing") + +col.label(text="Keys") + + +class PARTICLE_PT_physics_fluid_advanced(ParticleButtonsPanel, Panel): +bl_label = "Advanced" +bl_parent_id = "PARTICLE_PT_physics" +bl_options = {'DEFAULT_CLOSED'} +COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'} -if fluid.solver == 'DDR': -sub = col.column() -sub.prop(fluid, "repulsion", slider=fluid.factor_repulsion) -sub.prop(fluid, "factor_repulsion") +@classmethod +def poll(cls, context): +part = particle_get_settings(context) +fluid = part.fluid +if part.physics_type == 'FLUID': +return True +else: +return False -sub.prop(fluid, "stiff_viscosity", slider=fluid.factor_stiff_viscosity) -sub.prop(fluid, "factor_stiff_viscosity") +def draw(self, context): +layout = self.layout +layout.use_property_split = True +psys = context.particle_system +part = particle_get_settings(context) +fluid = part.fluid + +col = layout.column() + +if fluid.solver == 'DDR': sub = col.column() -sub.prop(fluid, "fluid_radius", slider=fluid.factor_radius) -sub.prop(fluid, "factor_radius") +sub.prop(fluid, "repulsion", slider=fluid.factor_repulsion) +sub.prop(fluid, "factor_repulsion") -sub.prop(fluid, "rest_density", slider=fluid.use_factor_density) -sub.prop(fluid, "use_factor_density") +sub.prop(fluid, "stiff_viscosity", slider=fluid.factor_stiff_viscosity) +sub.prop(fluid, "factor_stiff_viscosity") -if fluid.solver == 'CLASSICAL': -# With the classical solver, it is possible to calculate the -# spacing between particles when the fluid is at rest. This -# makes it easier to set stable initial conditions. -particle_volume = part.mass / fluid.rest_density -spacing = pow(particle_volume, 1.0 / 3.0) +sub = col.column() +sub.prop(fluid, "fluid_radius", slider=fluid.factor_radius) +sub.prop(fluid, "factor_radius") -sub.label(text="Spacing: %g" % spacing) +sub.prop(fluid, "rest_density", slider=fluid.use_factor_density) +sub.prop(fluid, "use_factor_density") -elif fluid.solver == 'DDR': +if fluid.solver == 'CLASSICAL': +# With the classical solver, it is possible to calculate the +# spacing between particles when the fluid is at rest. This +# makes it easier to set stable initial conditions. +particle_volume = part.mass / fluid.rest_density +spacing = pow(particle_volume, 1.0 / 3.0) -col.label(text="Springs") -col.prop(fluid, "spring_force", text="Force") -col.prop(fluid, "use_viscoelastic_springs") +sub.label(text="Spacing: %g" % spacing) -sub = col.column() -sub.active = fluid.use_viscoelastic_springs -sub.prop(fluid, "yield_ratio", slider=True) -sub.prop(fluid, "plasticity", slider=True) -col.label(text="Advanced") -sub = col.column() -sub.prop(fluid, "rest_length", slider=fluid.factor_rest_length) -
[Bf-blender-cvs] [03838548701] greasepencil-object: UI: Remove transform orientation options in Sculpt mode
Commit: 03838548701af0efb4b86350cbc0fc932a9eea9a Author: Antonio Vazquez Date: Wed Jul 25 16:01:18 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB03838548701af0efb4b86350cbc0fc932a9eea9a UI: Remove transform orientation options in Sculpt mode === M release/scripts/startup/bl_ui/space_view3d.py === diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 5f16da60fa6..355d07cabb7 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -120,7 +120,7 @@ class VIEW3D_HT_header(Header): scene = context.scene # Orientation -if object_mode in {'OBJECT', 'EDIT', 'POSE', 'GPENCIL_EDIT', 'GPENCIL_SCULPT'}: +if object_mode in {'OBJECT', 'EDIT', 'POSE', 'GPENCIL_EDIT'}: orientation = scene.transform_orientation current_orientation = scene.current_orientation ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b0077992d27] blender2.8: Cycles: add per layer collection mask/holdout support.
Commit: b0077992d2759b29b536187a226e8382b72261b6 Author: Brecht Van Lommel Date: Wed Jul 25 12:26:09 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBb0077992d2759b29b536187a226e8382b72261b6 Cycles: add per layer collection mask/holdout support. In the outliner, right click > view layer > set holdout. This is temporary until we have more general dynamic overrides, but helps Spring production for now. === M intern/cycles/blender/blender_object.cpp M intern/cycles/blender/blender_sync.h M release/scripts/startup/bl_ui/space_outliner.py M source/blender/blenkernel/intern/layer.c M source/blender/blenloader/intern/versioning_280.c M source/blender/editors/space_outliner/outliner_collections.c M source/blender/editors/space_outliner/outliner_intern.h M source/blender/editors/space_outliner/outliner_ops.c M source/blender/makesdna/DNA_layer_types.h M source/blender/makesrna/intern/rna_layer.c M source/blender/makesrna/intern/rna_object_api.c === diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 56365d12bab..fd8790c0c79 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -291,6 +291,7 @@ void BlenderSync::sync_background_light(bool use_portal) /* Object */ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph, + BL::ViewLayer& b_view_layer, BL::DepsgraphObjectInstance& b_instance, float motion_time, bool hide_tris, @@ -345,7 +346,8 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph, /* Visibility flags for both parent and child. */ PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles"); - bool use_holdout = get_boolean(cobject, "is_holdout"); + bool use_holdout = get_boolean(cobject, "is_holdout") || + b_ob.holdout_get(b_view_layer); uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY; if(b_parent.ptr.data != b_ob.ptr.data) { @@ -588,6 +590,7 @@ void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time) bool cancel = false; bool use_portal = false; + BL::ViewLayer b_view_layer = b_depsgraph.view_layer_eval(); BL::Depsgraph::mode_enum depsgraph_mode = b_depsgraph.mode(); BL::Depsgraph::object_instances_iterator b_instance_iter; @@ -609,6 +612,7 @@ void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time) if(!object_render_hide(b_ob, true, true, hide_tris, depsgraph_mode)) { /* object itself */ sync_object(b_depsgraph, + b_view_layer, b_instance, motion_time, hide_tris, diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index ba3f5e6428f..e63ef9e5e47 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -78,8 +78,6 @@ public: void sync_view(BL::SpaceView3D& b_v3d, BL::RegionView3D& b_rv3d, int width, int height); - inline int get_layer_samples() { return view_layer.samples; } - inline int get_layer_bound_samples() { return view_layer.bound_samples; } /* get parameters */ static SceneParams get_scene_params(BL::Scene& b_scene, @@ -126,6 +124,7 @@ private: bool motion, int motion_step = 0); Object *sync_object(BL::Depsgraph& b_depsgraph, + BL::ViewLayer& b_view_layer, BL::DepsgraphObjectInstance& b_instance, float motion_time, bool hide_tris, diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index 8f722c4d3ce..284a49c8789 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -142,8 +142,12 @@ class OUTLINER_MT_collection_view_layer(Menu): space = context.space_data -layout.operator("outliner.collection_exclude_set", text="Exclude") -layout.operator("outliner.collection_include_set", text="Include") +layout.operator("outliner.collection_exclude_set") +layout.operator("outliner.collection_exclude_clear") + +if context.engine == 'CYCLES': +layout.operator("outliner.collection_holdout_set") +layout.operator("outliner.collection_holdout_clear")
[Bf-blender-cvs] [41130ecf16b] blender2.8: Cleanup: mark missing Cycles view layer override features with TODO.
Commit: 41130ecf16b661391915e0ace14ee941045b4a52 Author: Brecht Van Lommel Date: Wed Jul 25 12:35:27 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB41130ecf16b661391915e0ace14ee941045b4a52 Cleanup: mark missing Cycles view layer override features with TODO. === M intern/cycles/blender/blender_mesh.cpp M intern/cycles/blender/blender_object.cpp M intern/cycles/blender/blender_session.cpp M intern/cycles/blender/blender_sync.cpp M intern/cycles/blender/blender_sync.h === diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 08206dd5521..8a6480a9a42 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -1080,27 +1080,18 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph& b_depsgraph, /* test if we can instance or if the object is modified */ BL::ID b_ob_data = b_ob.data(); BL::ID key = (BKE_object_is_modified(b_ob))? b_ob_instance: b_ob_data; - BL::Material material_override = view_layer.material_override; /* find shader indices */ vector used_shaders; BL::Object::material_slots_iterator slot; for(b_ob.material_slots.begin(slot); slot != b_ob.material_slots.end(); ++slot) { - if(material_override) { - find_shader(material_override, used_shaders, scene->default_surface); - } - else { - BL::ID b_material(slot->material()); - find_shader(b_material, used_shaders, scene->default_surface); - } + BL::ID b_material(slot->material()); + find_shader(b_material, used_shaders, scene->default_surface); } if(used_shaders.size() == 0) { - if(material_override) - find_shader(material_override, used_shaders, scene->default_surface); - else - used_shaders.push_back(scene->default_surface); + used_shaders.push_back(scene->default_surface); } /* test if we need to sync */ diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index ed01d728931..56365d12bab 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -292,7 +292,6 @@ void BlenderSync::sync_background_light(bool use_portal) Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph, BL::DepsgraphObjectInstance& b_instance, - uint layer_flag, float motion_time, bool hide_tris, BlenderObjectCulling& culling, @@ -314,10 +313,13 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph, } /* light is handled separately */ - if(object_is_light(b_ob)) { - /* don't use lights for excluded layers used as mask layer */ - if(!motion && !((layer_flag & view_layer.holdout_layer) && - (layer_flag & view_layer.exclude_layer))) + if(!motion && object_is_light(b_ob)) { + /* TODO: don't use lights for excluded layers used as mask layer, +* when dynamic overrides are back. */ +#if 0 + if(!((layer_flag & view_layer.holdout_layer) && +(layer_flag & view_layer.exclude_layer))) +#endif { sync_light(b_parent, persistent_id, @@ -343,23 +345,26 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph, /* Visibility flags for both parent and child. */ PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles"); - bool use_holdout = (layer_flag & view_layer.holdout_layer) != 0 || - get_boolean(cobject, "is_holdout"); + bool use_holdout = get_boolean(cobject, "is_holdout"); uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY; if(b_parent.ptr.data != b_ob.ptr.data) { visibility &= object_ray_visibility(b_parent); } - /* Make holdout objects on excluded layer invisible for non-camera rays. */ + /* TODO: make holdout objects on excluded layer invisible for non-camera rays. */ +#if 0 if(use_holdout && (layer_flag & view_layer.exclude_layer)) { visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA); } +#endif - /* Hide objects not on render layer from camera rays. */ + /* TODO: hide objects not on render layer from camera rays. */ +#if 0 if(!(layer_flag & view_layer.layer)) { visibility &= ~PATH_RAY_CAMERA
[Bf-blender-cvs] [5d0a3d3c9ce] blender2.8: UI: Dynamic Paint single column and sub panels
Commit: 5d0a3d3c9ce326ba0f90d43d8215b755418aa081 Author: William Reynish Date: Wed Jul 25 15:57:30 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB5d0a3d3c9ce326ba0f90d43d8215b755418aa081 UI: Dynamic Paint single column and sub panels === M release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py === diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 611f477a31b..44d07ff53e6 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -87,24 +87,22 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel): col.operator("dpaint.surface_slot_add", icon='ZOOMIN', text="") col.operator("dpaint.surface_slot_remove", icon='ZOOMOUT', text="") +layout.use_property_split = True + if surface: layout.prop(surface, "surface_format") col = layout.column() if surface.surface_format != 'VERTEX': -col.label(text="Quality:") col.prop(surface, "image_resolution") col.prop(surface, "use_antialiasing") -col = layout.column() -col.label(text="Frames:") -split = col.split() -col = split.column(align=True) -col.prop(surface, "frame_start", text="Start") -col.prop(surface, "frame_end", text="End") +sub = col.column(align=True) +sub.prop(surface, "frame_start", text="Frame Start") +sub.prop(surface, "frame_end", text="End") -split.prop(surface, "frame_substeps") +col.prop(surface, "frame_substeps") elif md.ui_type == 'BRUSH': brush = md.brush_settings @@ -114,16 +112,14 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel): else: layout.operator("dpaint.type_toggle", text="Remove Brush", icon='X').type = 'BRUSH' -split = layout.split() +layout.use_property_split = True -col = split.column() +col = layout.column() +col.prop(brush, "paint_color") +col.prop(brush, "paint_alpha", text="Alpha", slider=True) +col.prop(brush, "paint_wetness", text="Wetness", slider=True) col.prop(brush, "use_absolute_alpha") col.prop(brush, "use_paint_erase") -col.prop(brush, "paint_wetness", text="Wetness") - -col = split.column() -col.prop(brush, "paint_color", text="") -col.prop(brush, "paint_alpha", text="Alpha") class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel): @@ -141,65 +137,113 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel): canvas = context.dynamic_paint.canvas_settings surface = canvas.canvas_surfaces.active - surface_type = surface.surface_type +layout.use_property_split = True + layout.prop(surface, "surface_type") + layout.separator() -# dissolve -if surface_type == 'PAINT': -split = layout.split(percentage=0.35) -split.prop(surface, "use_drying", text="Dry:") - -col = split.column() -col.active = surface.use_drying -split = col.split(percentage=0.7) -col = split.column(align=True) -col.prop(surface, "dry_speed", text="Time") -col.prop(surface, "color_dry_threshold") -split.prop(surface, "use_dry_log", text="Slow") - -if surface_type != 'WAVE': -split = layout.split(percentage=0.35) -col = split.column() -if surface_type == 'WEIGHT': -col.prop(surface, "use_dissolve", text="Fade:") -else: -col.prop(surface, "use_dissolve", text="Dissolve:") -col = split.column() -col.active = surface.use_dissolve -split = col.split(percentage=0.7) -split.prop(surface, "dissolve_speed", text="Time") -split.prop(surface, "use_dissolve_log", text="Slow") +col = layout.column() # per type settings if surface_type == 'DISPLACE': -layout.prop(surface, "use_incremental_displace") +col.prop(surface, "use_incremental_displace") if surface.surface_format == 'VERTEX': -row = layout.row() -row.prop(surface, "depth_clamp") -row.prop(surface, "displace
[Bf-blender-cvs] [ddd32b09ec9] greasepencil-object: UI: Hide snap options in Paint, Sculpt and Weight mode
Commit: ddd32b09ec9c17215c7c441986d6a6361b4ab9f3 Author: Antonio Vazquez Date: Wed Jul 25 15:57:06 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBddd32b09ec9c17215c7c441986d6a6361b4ab9f3 UI: Hide snap options in Paint, Sculpt and Weight mode === M release/scripts/startup/bl_ui/space_view3d.py === diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index c22c3591814..5f16da60fa6 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -145,7 +145,8 @@ class VIEW3D_HT_header(Header): if obj is None: show_snap = True else: -if object_mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}: +if object_mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT', + 'GPENCIL_PAINT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}: show_snap = True else: ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0eb95d6ebc9] greasepencil-object: UI: Remove duplicated menu items
Commit: 0eb95d6ebc9701cf1ce539b7021e9c7689fae2b7 Author: Antonio Vazquez Date: Wed Jul 25 15:34:25 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB0eb95d6ebc9701cf1ce539b7021e9c7689fae2b7 UI: Remove duplicated menu items Some options were duplicated by error in previous commit. === M release/scripts/startup/bl_ui/space_view3d.py === diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index cda948943d8..c22c3591814 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3520,18 +3520,11 @@ class VIEW3D_MT_edit_gpencil(Menu): layout.menu("VIEW3D_MT_edit_gpencil_transform") -layout.separator() - -layout.operator("transform.bend", text="Bend") -layout.operator("transform.mirror", text="Mirror") -layout.operator("transform.shear", text="Shear") -layout.operator("transform.tosphere", text="To Sphere") layout.separator() layout.menu("GPENCIL_MT_snap") layout.separator() - layout.menu("VIEW3D_MT_object_animation") # NOTE: provides keyingset access... layout.menu("VIEW3D_MT_edit_gpencil_interpolate") @@ -3578,7 +3571,6 @@ class VIEW3D_MT_edit_gpencil(Menu): layout.separator() -layout.operator_menu_enum("gpencil.reproject", text="Reproject Strokes...", property="type") layout.operator_menu_enum("gpencil.frame_clean_fill", text="Clean Boundary Strokes...", property="mode") ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [421017d24a0] blender2.8: UI: Node Editor Properties single column
Commit: 421017d24a05f7c83c3933d158b9cf7b8f28c00c Author: Pablo Vazquez Date: Wed Jul 25 15:04:19 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB421017d24a05f7c83c3933d158b9cf7b8f28c00c UI: Node Editor Properties single column Color and Properties panels as sub-panels of Node. Collapse Node properties by default, since they are already in the node itself and in material properties. === M release/scripts/startup/bl_ui/space_node.py === diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 9d8c14ba9c3..45343c09b27 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -364,7 +364,6 @@ class NODE_PT_active_node_generic(Panel): bl_space_type = 'NODE_EDITOR' bl_region_type = 'UI' bl_label = "Node" -#bl_options = {'HIDE_HEADER'} @classmethod def poll(cls, context): @@ -383,6 +382,7 @@ class NODE_PT_active_node_color(Panel): bl_region_type = 'UI' bl_label = "Color" bl_options = {'DEFAULT_CLOSED'} +bl_parent_id = 'NODE_PT_active_node_generic' @classmethod def poll(cls, context): @@ -410,6 +410,8 @@ class NODE_PT_active_node_properties(Panel): bl_space_type = 'NODE_EDITOR' bl_region_type = 'UI' bl_label = "Properties" +bl_options = {'DEFAULT_CLOSED'} +bl_parent_id = 'NODE_PT_active_node_generic' @classmethod def poll(cls, context): @@ -453,18 +455,22 @@ class NODE_PT_backdrop(Panel): def draw(self, context): layout = self.layout +layout.use_property_split = True snode = context.space_data layout.active = snode.show_backdrop -layout.prop(snode, "backdrop_channels", text="") -layout.prop(snode, "backdrop_zoom", text="Zoom") -col = layout.column(align=True) -col.label(text="Offset:") -col.prop(snode, "backdrop_offset", text="") -col.operator("node.backimage_move", text="Move") +col = layout.column() + +col.prop(snode, "backdrop_channels", text="Channels") +col.prop(snode, "backdrop_zoom", text="Zoom") -layout.operator("node.backimage_fit", text="Fit") +col.prop(snode, "backdrop_offset", text="Offset") + +col.separator() + +col.operator("node.backimage_move", text="Move") +col.operator("node.backimage_fit", text="Fit") class NODE_PT_quality(bpy.types.Panel): @@ -479,6 +485,7 @@ class NODE_PT_quality(bpy.types.Panel): def draw(self, context): layout = self.layout +layout.use_property_split = True snode = context.space_data tree = snode.node_tree @@ -522,6 +529,7 @@ class NODE_UL_interface_sockets(bpy.types.UIList): class NODE_PT_grease_pencil(GreasePencilDataPanel, Panel): bl_space_type = 'NODE_EDITOR' bl_region_type = 'UI' +bl_options = {'DEFAULT_CLOSED'} # NOTE: this is just a wrapper around the generic GP Panel ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5f1ead63953] blender2.8: Fix T55895: VSE crash while moving a strip
Commit: 5f1ead63953527abd9ddca16986990d59f123aff Author: Bastien Montagne Date: Wed Jul 25 14:52:29 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB5f1ead63953527abd9ddca16986990d59f123aff Fix T55895: VSE crash while moving a strip Glitch from multi-edit project. ;) === M source/blender/editors/transform/transform_snap.c === diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index b67fd22dbff..54253e36351 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1462,7 +1462,7 @@ void snapSequenceBounds(TransInfo *t, const int mval[2]) float xmouse, ymouse; int frame; int mframe; - TransSeq *ts = t->custom.type.data; + TransSeq *ts = TRANS_DATA_CONTAINER_FIRST_SINGLE(t)->custom.type.data; /* reuse increment, strictly speaking could be another snap mode, but leave as is */ if (!(t->modifiers & MOD_SNAP_INVERT)) return; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4183e62d1b4] blender2.8: UI: Texture Properties Layout and Cleanup
Commit: 4183e62d1b4c39fe6f4ef75951b066249147e01a Author: Vuk Gardašević Date: Wed Jul 25 14:01:01 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB4183e62d1b4c39fe6f4ef75951b066249147e01a UI: Texture Properties Layout and Cleanup Initial work on single column layout, flow and organization of the texture properties. More work needs to be done in the C templates for image textures. See D3557 === M release/scripts/startup/bl_ui/properties_texture.py === diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index d937f2470b8..a4f6f753669 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -17,19 +17,21 @@ # # END GPL LICENSE BLOCK # # -import bpy -from bpy.types import Menu, Panel, UIList +import bpy +from bpy.types import ( +Menu, +Panel, +UIList, +) from bpy.types import ( Brush, FreestyleLineStyle, -Object, ParticleSettings, Texture, ) from rna_prop_ui import PropertyPanel - from .properties_paint_common import brush_texture_settings @@ -47,9 +49,9 @@ class TEXTURE_MT_specials(Menu): class TEXTURE_UL_texslots(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): -ma = data slot = item tex = slot.texture if slot else None + if self.layout_type in {'DEFAULT', 'COMPACT'}: if tex: layout.prop(tex, "name", text="", emboss=False, icon_value=icon) @@ -131,18 +133,18 @@ class TEXTURE_PT_context(TextureButtonsPanel, Panel): if not pin_id: col.template_texture_user() -col.separator() - if user or pin_id: +col.separator() + if pin_id: col.template_ID(space, "pin_id") else: propname = context.texture_user_property.identifier col.template_ID(user, propname, new="texture.new") -col.separator() - if tex: +col.separator() + split = col.split(percentage=0.2) split.label(text="Type") split.prop(tex, "type", text="") @@ -179,25 +181,35 @@ class TEXTURE_PT_node_mapping(TextureButtonsPanel, Panel): def draw(self, context): layout = self.layout +layout.use_property_split = True +layout.use_property_decorate = False # No animation. + +flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) node = context.texture_node mapping = node.texture_mapping -layout.prop(mapping, "vector_type", expand=True) +col = flow.column() +col.prop(mapping, "vector_type") + +col.separator() + +col = col.column(align=True) +col.prop(mapping, "mapping_x", text="Projection X") +col.prop(mapping, "mapping_y", text="Y") +col.prop(mapping, "mapping_z", text="Z") -row = layout.row() +col.separator() -row.column().prop(mapping, "translation") -row.column().prop(mapping, "rotation") -row.column().prop(mapping, "scale") +col = flow.column() +col.column().prop(mapping, "translation") -layout.label(text="Projection:") +col = flow.column() +col.column().prop(mapping, "rotation") -row = layout.row() -row.prop(mapping, "mapping_x", text="") -row.prop(mapping, "mapping_y", text="") -row.prop(mapping, "mapping_z", text="") +col = flow.column() +col.column().prop(mapping, "scale") class TextureTypePanel(TextureButtonsPanel): @@ -216,21 +228,29 @@ class TEXTURE_PT_clouds(TextureTypePanel, Panel): def draw(self, context): layout = self.layout +layout.use_property_split = True +flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) tex = context.texture -layout.row().prop(tex, "cloud_type", expand=True) -layout.label(text="Noise:") -layout.row().prop(tex, "noise_type", text="Type", expand=True) -layout.prop(tex, "noise_basis", text="Basis") +col = flow.column() +col.prop(tex, "noise_basis", text="Noise Basis") + +col.separator() + +col.prop(tex, "noise_type", text="Type") + +col.separator() -split = layout.split() +col = flow.column() +col.prop(tex, "cloud_type") -col = split.column() +col.separator() + +col = flow.column() col.prop(tex, "noise_scale", text="Size") col.prop(tex, "noise_depth", text="Depth") - -split.prop(tex, "nabla",
[Bf-blender-cvs] [f3524fe759e] blender2.8: UI: Minor tweaks to nodes
Commit: f3524fe759e8ad42ab305cf2e1636959914cc97e Author: Pablo Vazquez Date: Wed Jul 25 12:53:15 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBf3524fe759e8ad42ab305cf2e1636959914cc97e UI: Minor tweaks to nodes Match roundness with widget defaults and collapse triangle size with panel's. Interaction is the same, just an aesthetic tweak. === M source/blender/editors/interface/interface_panel.c M source/blender/editors/space_node/node_draw.c M source/blender/editors/space_node/node_intern.h === diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 59fdf7e672d..aa67d58fd57 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -454,9 +454,9 @@ static void ui_offset_panel_block(uiBlock *block) /* triangle 'icon' for panel header */ void UI_draw_icon_tri(float x, float y, char dir, const float color[4]) { - float f3 = 0.15 * U.widget_unit; - float f5 = 0.25 * U.widget_unit; - float f7 = 0.35 * U.widget_unit; + float f3 = 0.05 * U.widget_unit; + float f5 = 0.15 * U.widget_unit; + float f7 = 0.25 * U.widget_unit; if (dir == 'h') { UI_draw_anti_tria(x - f3, y - f5, x - f3, y + f5, x + f7, y, color); diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 4b3a3abc642..bba46771674 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -951,18 +951,18 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN /* open/close entirely? */ { uiBut *but; - int but_size = UI_UNIT_X * 0.6f; + int but_size = UI_UNIT_X * 1.2f; /* XXX button uses a custom triangle draw below, so make it invisible without icon */ UI_block_emboss_set(node->block, UI_EMBOSS_NONE); but = uiDefBut(node->block, UI_BTYPE_BUT_TOGGLE, B_REDR, "", - rct->xmin + 0.5f * U.widget_unit - but_size / 2, rct->ymax - NODE_DY / 2.0f - but_size / 2, + rct->xmin + 0.6f * U.widget_unit - but_size / 2, rct->ymax - NODE_DY / 2.2f - but_size / 2, but_size, but_size, NULL, 0, 0, 0, 0, ""); UI_but_func_set(but, node_toggle_button_cb, node, (void *)"NODE_OT_hide_toggle"); UI_block_emboss_set(node->block, UI_EMBOSS); UI_GetThemeColor4fv(TH_TEXT, color); /* custom draw function for this button */ - UI_draw_icon_tri(rct->xmin + 0.5f * U.widget_unit, rct->ymax - NODE_DY / 2.0f, 'v', color); + UI_draw_icon_tri(rct->xmin + 0.6f * U.widget_unit, rct->ymax - NODE_DY / 2.2f, 'v', color); } nodeLabel(ntree, node, showname, sizeof(showname)); @@ -1071,7 +1071,7 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b /* open entirely icon */ { uiBut *but; - int but_size = UI_UNIT_X * 0.6f; + int but_size = UI_UNIT_X * 1.2f; /* XXX button uses a custom triangle draw below, so make it invisible without icon */ UI_block_emboss_set(node->block, UI_EMBOSS_NONE); but = uiDefBut(node->block, UI_BTYPE_BUT_TOGGLE, B_REDR, "", diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index ed7379acca9..3644c8d09e6 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -238,7 +238,7 @@ extern const char *node_context_dir[]; // nodes draw without dpi - the view zoom is flexible #define HIDDEN_RAD (0.75f * U.widget_unit) -#define BASIS_RAD (0.4f * U.widget_unit) +#define BASIS_RAD (0.2f * U.widget_unit) #define NODE_DYS(U.widget_unit / 2) #define NODE_DY U.widget_unit #define NODE_SOCKDY (0.08f * U.widget_unit) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b2d0bdf8781] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Commit: b2d0bdf8781d29b3f4b71ba16a29c59a1da34fcf Author: Antonio Vazquez Date: Wed Jul 25 13:21:39 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBb2d0bdf8781d29b3f4b71ba16a29c59a1da34fcf 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] [5417c395640] greasepencil-object: UI: Move Shapes panel to Header
Commit: 5417c395640bd2223390e8399beac66f9bd1b380 Author: Antonio Vazquez Date: Wed Jul 25 13:20:44 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB5417c395640bd2223390e8399beac66f9bd1b380 UI: Move Shapes panel to Header === M release/scripts/startup/bl_ui/space_view3d.py M release/scripts/startup/bl_ui/space_view3d_toolbar.py === diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index db7e626acc4..cda948943d8 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -81,6 +81,13 @@ class VIEW3D_HT_header(Header): if obj and obj.type == 'GPENCIL' and context.gpencil_data: gpd = context.gpencil_data +if gpd.is_stroke_paint_mode: +row = layout.row(align=True) +row.popover( +panel="VIEW3D_PT_tools_grease_pencil_shapes", +text="Shapes" +) + if gpd.use_stroke_edit_mode or gpd.is_stroke_sculpt_mode or gpd.is_stroke_weight_mode: row = layout.row(align=True) row.prop(gpd, "use_multiedit", text="", icon="FORCE_HARMONIC") diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 366edb9cee1..cc2e1d659e5 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1587,10 +1587,9 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel): # Grease Pencil create shapes -class VIEW3D_PT_tools_grease_pencil_shapes(Panel): +class VIEW3D_PT_tools_grease_pencil_shapes(View3DPanel, Panel): bl_space_type = 'VIEW_3D' -bl_category = "Create" -bl_region_type = 'TOOLS' +bl_region_type = 'HEADER' bl_label = "Shapes" @classmethod @@ -1777,8 +1776,7 @@ classes = ( VIEW3D_PT_tools_grease_pencil_brush_stabilizer, VIEW3D_PT_tools_grease_pencil_brush_random, VIEW3D_PT_tools_grease_pencil_brushcurves, -# GPXX: review -# VIEW3D_PT_tools_grease_pencil_shapes, +VIEW3D_PT_tools_grease_pencil_shapes, VIEW3D_PT_tools_grease_pencil_sculpt, VIEW3D_PT_tools_grease_pencil_weight_paint, VIEW3D_PT_tools_grease_pencil_weight_tools, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6ef94c6407d] greasepencil-object: UI: Remove more old Toolbar panels
Commit: 6ef94c6407d97465aa2b6b67c42603305b9b94c1 Author: Antonio Vazquez Date: Wed Jul 25 12:47:57 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB6ef94c6407d97465aa2b6b67c42603305b9b94c1 UI: Remove more old Toolbar panels The options has been moved to header or menu === M release/scripts/startup/bl_ui/space_view3d.py M release/scripts/startup/bl_ui/space_view3d_toolbar.py === diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index ad03defcc99..db7e626acc4 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -100,6 +100,11 @@ class VIEW3D_HT_header(Header): row = layout.row(align=True) row.prop(tool_settings.gpencil_sculpt, "use_select_mask", text="") +row.popover( +panel="VIEW3D_PT_tools_grease_pencil_interpolate", +text="Interpolate" +) + VIEW3D_MT_editor_menus.draw_collapsible(context, layout) layout.separator_spacer() @@ -278,6 +283,7 @@ class VIEW3D_MT_editor_menus(Menu): if gp_edit: layout.menu("VIEW3D_MT_edit_gpencil") +layout.menu("VIEW3D_MT_gpencil_animation") elif edit_object: layout.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower()) @@ -3506,16 +3512,19 @@ class VIEW3D_MT_edit_gpencil(Menu): layout = self.layout layout.menu("VIEW3D_MT_edit_gpencil_transform") -layout.operator("transform.mirror", text="Mirror") -layout.menu("GPENCIL_MT_snap") layout.separator() -layout.operator("gpencil.brush_paint", text="Sculpt Strokes").wait_for_input = True -layout.prop_menu_enum(tool_settings.gpencil_sculpt, "tool", text="Sculpt Brush") +layout.operator("transform.bend", text="Bend") +layout.operator("transform.mirror", text="Mirror") +layout.operator("transform.shear", text="Shear") +layout.operator("transform.tosphere", text="To Sphere") +layout.separator() +layout.menu("GPENCIL_MT_snap") layout.separator() + layout.menu("VIEW3D_MT_object_animation") # NOTE: provides keyingset access... layout.menu("VIEW3D_MT_edit_gpencil_interpolate") @@ -3523,6 +3532,8 @@ class VIEW3D_MT_edit_gpencil(Menu): layout.operator("gpencil.duplicate_move", text="Duplicate") layout.operator("gpencil.stroke_subdivide", text="Subdivide") +layout.operator("gpencil.stroke_simplify_fixed", text="Simplify") +layout.operator("gpencil.stroke_simplify", text="Adaptative") layout.separator() @@ -3534,7 +3545,8 @@ class VIEW3D_MT_edit_gpencil(Menu): layout.separator() layout.operator("gpencil.copy", text="Copy") -layout.operator("gpencil.paste", text="Paste") +layout.operator("gpencil.paste", text="Paste").type = 'COPY' +layout.operator("gpencil.paste", text="Paste & Merge").type = 'MERGE' layout.separator() @@ -3555,7 +3567,35 @@ class VIEW3D_MT_edit_gpencil(Menu): layout.separator() layout.menu("VIEW3D_MT_edit_gpencil_delete") +layout.operator("gpencil.stroke_cyclical_set", text="Toggle Cyclic").type = 'TOGGLE' + +layout.separator() + +layout.operator_menu_enum("gpencil.reproject", text="Reproject Strokes...", property="type") +layout.operator_menu_enum("gpencil.frame_clean_fill", text="Clean Boundary Strokes...", property="mode") + +class VIEW3D_MT_gpencil_animation(Menu): +bl_label = "Animation" + +@classmethod +def poll(cls, context): +ob = context.active_object +return ob and ob.type == 'GPENCIL' and ob.mode != 'OBJECT' + +@staticmethod +def draw(self, context): +layout = self.layout + +layout.operator("gpencil.blank_frame_add", icon='NEW') +layout.operator("gpencil.active_frames_delete_all", icon='X', text="Delete Frame(s)") + +layout.separator() +layout.operator("gpencil.frame_duplicate", text="Duplicate Active Frame") +layout.operator("gpencil.frame_duplicate", text="Duplicate All Layers").mode = 'ALL' + +layout.separator() +layout.prop(context.tool_settings, "use_gpencil_additive_drawing", text="Additive Drawing") class VIEW3D_MT_edit_gpencil_transform(Menu): bl_label = "Transform" @@ -4874,6 +4914,7 @@ classes = ( VIEW3D_MT_edit_mesh_showhide, VIEW3D_MT_edit_gpencil, VIEW3D_MT_edit_gpencil_delete, +VIEW3D_MT_gpencil_animation, VIEW3D_MT_edit_curve, VIEW3D_MT_edit_curve_ctrlpoints, VIEW3D_MT_edit_curve_segments, diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/b
[Bf-blender-cvs] [ee9d3750450] blender2.8: UI: Add "New" and "Open..." to the File Context Menu
Commit: ee9d3750450cbf290565ee5048e52acdf027d222 Author: Pablo Vazquez Date: Wed Jul 25 11:56:37 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBee9d3750450cbf290565ee5048e52acdf027d222 UI: Add "New" and "Open..." to the File Context Menu Puts both operators at easy reach with the left hand since the shortcuts for these are somewhat cumbersome (Ctrl+O/Ctrl+N) === M release/scripts/startup/bl_ui/space_topbar.py === diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 96ef2e51e60..77cc0f7c34e 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -265,8 +265,8 @@ class INFO_MT_file(Menu): layout.separator() layout.operator_context = 'INVOKE_AREA' -layout.operator("wm.link", text="Link", icon='LINK_BLEND') -layout.operator("wm.append", text="Append", icon='APPEND_BLEND') +layout.operator("wm.link", text="Link...", icon='LINK_BLEND') +layout.operator("wm.append", text="Append...", icon='APPEND_BLEND') layout.menu("INFO_MT_file_previews") layout.separator() @@ -539,8 +539,13 @@ class TOPBAR_MT_file_specials(Menu): layout = self.layout layout.operator_context = 'INVOKE_AREA' -layout.operator("wm.link", text="Link", icon='LINK_BLEND') -layout.operator("wm.append", text="Append", icon='APPEND_BLEND') +layout.operator("wm.read_homefile", text="New", icon='NEW') +layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER') + +layout.separator() + +layout.operator("wm.link", text="Link...", icon='LINK_BLEND') +layout.operator("wm.append", text="Append...", icon='APPEND_BLEND') layout.separator() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bdf4967db76] greasepencil-object: UI: First changes in Edit Toolbar
Commit: bdf4967db762a8c82728f2af5855b09293edccc6 Author: Antonio Vazquez Date: Wed Jul 25 11:53:58 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBbdf4967db762a8c82728f2af5855b09293edccc6 UI: First changes in Edit Toolbar - Add transform tools - Move Bend, Mirror, Shear and ToSphere as Tools === M release/scripts/startup/bl_ui/properties_grease_pencil_common.py M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py === diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index f972c467182..1bc8426b61a 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -201,12 +201,6 @@ class GreasePencilStrokeEditPanel: layout.separator() -col = layout.column(align=True) -col.operator("transform.bend", text="Bend") -col.operator("transform.mirror", text="Mirror") -col.operator("transform.shear", text="Shear") -col.operator("transform.tosphere", text="To Sphere") - layout.separator() col = layout.column(align=True) col.operator_menu_enum("gpencil.stroke_arrange", text="Arrange Strokes...", property="direction") diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 17caf693fd7..c6015a855cd 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1102,6 +1102,61 @@ class _defs_gpencil_paint: ) ) + +class _defs_gpencil_edit: +@ToolDef.from_fn +def bend(): +return dict( +text="Bend", +icon="ops.transform.bend", +widget=None, +keymap=( +("transform.bend", + dict(), + dict(type='EVT_TWEAK_A', value='ANY')), +), +) + +@ToolDef.from_fn +def mirror(): +return dict( +text="Mirror", +icon="ops.transform.mirror", +widget=None, +keymap=( +("transform.mirror", + dict(), + dict(type='EVT_TWEAK_A', value='ANY')), +), +) + +@ToolDef.from_fn +def shear(): +return dict( +text="Shear", +icon="ops.transform.shear", +widget=None, +keymap=( +("transform.shear", + dict(), + dict(type='EVT_TWEAK_A', value='ANY')), +), +) + +@ToolDef.from_fn +def tosphere(): +return dict( +text="To Sphere", +icon="ops.transform.tospehere", +widget=None, +keymap=( +("transform.tosphere", + dict(), + dict(type='EVT_TWEAK_A', value='ANY')), +), +) + + class _defs_gpencil_sculpt: @classmethod def draw_settings_common(cls, context, layout, tool): @@ -1538,6 +1593,16 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): 'GPENCIL_PAINT': [ _defs_gpencil_paint.generate_from_brushes, ], +'GPENCIL_EDIT': [ +*_tools_select, +None, +*_tools_transform, +None, +_defs_gpencil_edit.bend, +_defs_gpencil_edit.mirror, +_defs_gpencil_edit.shear, +_defs_gpencil_edit.tosphere, +], 'GPENCIL_SCULPT': [ _defs_gpencil_sculpt.smooth, _defs_gpencil_sculpt.thickness, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [509d87230a1] blender2.8: Fix missing particle use count object names with disabled particles.
Commit: 509d87230a1c744d555b8b25a3a6069f68d21c5b Author: Brecht Van Lommel Date: Wed Jul 25 11:39:32 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB509d87230a1c744d555b8b25a3a6069f68d21c5b Fix missing particle use count object names with disabled particles. === M source/blender/makesrna/intern/rna_particle.c === diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 4b8299b9245..979e5d433e7 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1132,6 +1132,9 @@ static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str) { + ParticleSettings *part = (ParticleSettings *)ptr->id.data; + psys_find_group_weights(part); + ParticleDupliWeight *dw = ptr->data; if (dw->ob) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ea8f7878f6c] soc-2018-npr: Added debug shaders to find problems in f12
Commit: ea8f7878f6cad888c0e1491d2f243874178e21dc Author: Nick Wu Date: Wed Jul 25 16:39:58 2018 +0800 Branches: soc-2018-npr https://developer.blender.org/rBea8f7878f6cad888c0e1491d2f243874178e21dc Added debug shaders to find problems in f12 === M source/blender/draw/engines/lanpr/lanpr_all.h M source/blender/draw/engines/lanpr/lanpr_engine.c M source/blender/draw/engines/lanpr/lanpr_ops.c === diff --git a/source/blender/draw/engines/lanpr/lanpr_all.h b/source/blender/draw/engines/lanpr/lanpr_all.h index 610317c2316..0ab2c80eccb 100644 --- a/source/blender/draw/engines/lanpr/lanpr_all.h +++ b/source/blender/draw/engines/lanpr/lanpr_all.h @@ -66,6 +66,9 @@ typedef struct LANPROneTimeInit { GPUShader *software_shader; GPUShader *software_chaining_shader; + /* For Debug... */ + GPUShader *debug_shader; + void *ved; @@ -111,6 +114,9 @@ typedef struct LANPR_PassList { /* SOFTWARE */ struct DRWPass *software_pass; + /* DEBUG */ + struct DRWPass *debug_pass; + } LANPR_PassList; typedef struct LANPR_FramebufferList { @@ -161,6 +167,8 @@ typedef struct LANPR_PrivateData { DRWShadingGroup *dpix_transform_shgrp; DRWShadingGroup *dpix_preview_shgrp; + DRWShadingGroup *debug_shgrp; + // moved into line layer. //DRWShadingGroup *software_shgrp; @@ -797,3 +805,6 @@ void lanpr_create_atlas_intersection_preview(void *vedata, int begin_index); void lanpr_dpix_draw_scene(LANPR_TextureList *txl, LANPR_FramebufferList *fbl, LANPR_PassList *psl, LANPR_PrivateData *pd, SceneLANPR *lanpr, GPUFrameBuffer *DefaultFB); void lanpr_snake_draw_scene(LANPR_TextureList *txl, LANPR_FramebufferList *fbl, LANPR_PassList *psl, LANPR_PrivateData *pd, SceneLANPR *lanpr, GPUFrameBuffer *DefaultFB); + +void lanpr_software_draw_scene(void *vedata, GPUFrameBuffer *dfb); + diff --git a/source/blender/draw/engines/lanpr/lanpr_engine.c b/source/blender/draw/engines/lanpr/lanpr_engine.c index 54558abf717..755801b6585 100644 --- a/source/blender/draw/engines/lanpr/lanpr_engine.c +++ b/source/blender/draw/engines/lanpr/lanpr_engine.c @@ -41,8 +41,8 @@ extern char datatoc_lanpr_dpix_project_passthrough_vert_glsl[]; extern char datatoc_lanpr_dpix_project_clip_frag_glsl[]; extern char datatoc_lanpr_dpix_preview_frag_glsl[]; extern char datatoc_lanpr_software_passthrough_vert_glsl[]; - - +extern char datatoc_gpu_shader_2D_smooth_color_vert_glsl[]; +extern char datatoc_gpu_shader_2D_smooth_color_frag_glsl[]; LANPROneTimeInit OneTime; @@ -198,6 +198,16 @@ static void lanpr_engine_init(void *ved){ GPU_ATTACHMENT_LEAVE }); + /* Debug */ + if (!OneTime.debug_shader) { + OneTime.debug_shader = + GPU_shader_create( + datatoc_gpu_shader_2D_smooth_color_vert_glsl, + datatoc_gpu_shader_2D_smooth_color_frag_glsl, + NULL, + NULL, NULL); + } + } static void lanpr_engine_free(void){ void *ved = OneTime.ved; @@ -465,6 +475,45 @@ static void lanpr_draw_scene_exec(void *vedata, GPUFrameBuffer *dfb) { camera = scene->camera; } + //DEBUG, draw a square only + { + GPU_framebuffer_bind(fbl->software_ms); + GPU_framebuffer_clear(fbl->software_ms, clear_bits, lanpr->background_color, clear_depth, clear_stencil); + + psl->debug_pass = psl->software_pass = DRW_pass_create("Debug Pass", DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL); + pd->debug_shgrp = DRW_shgroup_create(OneTime.debug_shader, psl->debug_pass); + + static struct GPUBatch *square_batch = NULL; + if (!square_batch) { + static GPUVertFormat format = { 0 }; + static struct { uint pos, color; } attr_id; + if (format.attr_len == 0) { + attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); + attr_id.color = GPU_vertformat_attr_add(&format, "color", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); + } + GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); + GPU_vertbuf_data_alloc(vbo, 4); + + float v[4] = { 0 }, c[4] = { 1,1,1,1 }; + GPU_vertbuf_attr_set(vbo, attr_id.pos, 0, v); GPU_vertbuf_attr_set(vbo, attr_id.color, 0, c); + v[0] = 0.9; + GPU_vertbuf_attr_set(vbo, attr_id.pos, 1, v); GPU_vertbuf_attr_set(vbo, attr_id.color, 1, c); + v[1] = 0.9; +
[Bf-blender-cvs] [88448dba155] soc-2018-npr: Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
Commit: 88448dba155453fd265c228b3970d1eb86f1e101 Author: Nick Wu Date: Wed Jul 25 13:43:14 2018 +0800 Branches: soc-2018-npr https://developer.blender.org/rB88448dba155453fd265c228b3970d1eb86f1e101 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs