[Bf-blender-cvs] [0bc6e431cc4] soc-2018-npr: Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
Nick Wu
noreply at git.blender.org
Sat Oct 20 07:06:00 CEST 2018
Commit: 0bc6e431cc47fa41c2544d6ffead19c61bac2a68
Author: Nick Wu
Date: Wed Oct 3 18:30:02 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rB0bc6e431cc47fa41c2544d6ffead19c61bac2a68
Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
# source/blender/makesrna/intern/rna_scene.c
===================================================================
===================================================================
diff --cc release/scripts/startup/bl_ui/properties_scene.py
index b14215fb8c5,2cabefe905e..4962a5c7626
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@@ -82,11 -74,8 +74,8 @@@ class SCENE_PT_scene(SceneButtonsPanel
class SCENE_PT_unit(SceneButtonsPanel, Panel):
bl_label = "Units"
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL', "BLENDER_LANPR"}
- def draw_header_preset(self, context):
- SCENE_PT_units_length_presets.draw_panel_header(self.layout)
-
def draw(self, context):
layout = self.layout
diff --cc source/blender/makesdna/DNA_scene_types.h
index 58edfcec8cd,15e8f950686..93f129c3290
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@@ -2171,25 -2123,31 +2188,31 @@@ typedef enum eGPencil_Placement_Flags
GP_PROJECT_CURSOR = (1 << 5),
} eGPencil_Placement_Flags;
+ /* ToolSettings.gpencil_selectmode */
+ typedef enum eGPencil_Selectmode_types {
+ GP_SELECTMODE_POINT = 0,
+ GP_SELECTMODE_STROKE = 1
+ } eGPencil_Selectmode_types;
+
/* ToolSettings.particle flag */
-#define PE_KEEP_LENGTHS 1
-#define PE_LOCK_FIRST 2
-#define PE_DEFLECT_EMITTER 4
-#define PE_INTERPOLATE_ADDED 8
-#define PE_DRAW_PART 16
+#define PE_KEEP_LENGTHS 1
+#define PE_LOCK_FIRST 2
+#define PE_DEFLECT_EMITTER 4
+#define PE_INTERPOLATE_ADDED 8
+#define PE_DRAW_PART 16
/* #define PE_X_MIRROR 64 */ /* deprecated */
-#define PE_FADE_TIME 128
-#define PE_AUTO_VELOCITY 256
+#define PE_FADE_TIME 128
+#define PE_AUTO_VELOCITY 256
/* ParticleEditSettings.brushtype */
-#define PE_BRUSH_NONE -1
-#define PE_BRUSH_COMB 0
-#define PE_BRUSH_CUT 1
-#define PE_BRUSH_LENGTH 2
-#define PE_BRUSH_PUFF 3
-#define PE_BRUSH_ADD 4
-#define PE_BRUSH_SMOOTH 5
-#define PE_BRUSH_WEIGHT 6
+#define PE_BRUSH_NONE -1
+#define PE_BRUSH_COMB 0
+#define PE_BRUSH_CUT 1
+#define PE_BRUSH_LENGTH 2
+#define PE_BRUSH_PUFF 3
+#define PE_BRUSH_ADD 4
+#define PE_BRUSH_SMOOTH 5
+#define PE_BRUSH_WEIGHT 6
/* ParticleBrushData.flag */
#define PE_BRUSH_DATA_PUFF_VOLUME 1
@@@ -2204,13 -2162,14 +2227,14 @@@
/* UnitSettings */
+ #define USER_UNIT_ADAPTIVE 0xFF
/* UnitSettings.system */
-#define USER_UNIT_NONE 0
-#define USER_UNIT_METRIC 1
-#define USER_UNIT_IMPERIAL 2
+#define USER_UNIT_NONE 0
+#define USER_UNIT_METRIC 1
+#define USER_UNIT_IMPERIAL 2
/* UnitSettings.flag */
-#define USER_UNIT_OPT_SPLIT 1
-#define USER_UNIT_ROT_RADIANS 2
+#define USER_UNIT_OPT_SPLIT 1
+#define USER_UNIT_ROT_RADIANS 2
/* SceneEEVEE->flag */
enum {
diff --cc source/blender/makesrna/intern/rna_scene.c
index ed44c3df058,11d56206d6e..661c0620b07
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@@ -2017,57 -2016,69 +2018,120 @@@ const EnumPropertyItem *rna_TransformOr
return item;
}
+ static const EnumPropertyItem *get_unit_enum_items(int system, int type, bool *r_free)
+ {
+ const void *usys;
+ int len;
+ bUnit_GetSystem(system, type, &usys, &len);
+
+ EnumPropertyItem *items = NULL;
+ int totitem = 0;
+
+ EnumPropertyItem adaptive = { 0 };
+ adaptive.identifier = "ADAPTIVE";
+ adaptive.name = "Adaptive";
+ adaptive.value = USER_UNIT_ADAPTIVE;
+ RNA_enum_item_add(&items, &totitem, &adaptive);
+
+ for (int i = 0; i < len; i++) {
+ if (!bUnit_IsSuppressed(usys, i)) {
+ EnumPropertyItem tmp = { 0 };
+ tmp.identifier = bUnit_GetName(usys, i);
+ tmp.name = bUnit_GetNameDisplay(usys, i);
+ tmp.value = i;
+ RNA_enum_item_add(&items, &totitem, &tmp);
+ }
+ }
+
+ *r_free = true;
+ return items;
+ }
+
+ const EnumPropertyItem *rna_get_length_unit_items(
+ bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
+ {
+ UnitSettings *units = ptr->data;
+ return get_unit_enum_items(units->system, B_UNIT_LENGTH, r_free);
+ }
+
+ const EnumPropertyItem *rna_get_mass_unit_items(
+ bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
+ {
+ UnitSettings *units = ptr->data;
+ return get_unit_enum_items(units->system, B_UNIT_MASS, r_free);
+ }
+
+ const EnumPropertyItem *rna_get_time_unit_items(
+ bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
+ {
+ UnitSettings *units = ptr->data;
+ return get_unit_enum_items(units->system, B_UNIT_TIME, r_free);
+ }
+
+ static void rna_unit_system_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
+ {
+ UnitSettings *unit = &scene->unit;
+ if (unit->system == USER_UNIT_NONE) {
+ unit->length_unit = USER_UNIT_ADAPTIVE;
+ unit->mass_unit = USER_UNIT_ADAPTIVE;
+ }
+ else {
+ unit->length_unit = bUnit_GetBaseUnitOfType(unit->system, B_UNIT_LENGTH);
+ unit->mass_unit = bUnit_GetBaseUnitOfType(unit->system, B_UNIT_MASS);
+ }
+ }
+
+
+/* lanpr */
+
+void rna_lanpr_active_line_layer_index_range(
+ PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
+{
+ SceneLANPR *lanpr = (SceneLANPR *)ptr->data;
+ *min = 0;
+ *max = max_ii(0, BLI_listbase_count(&lanpr->line_layers) - 1);
+}
+
+int rna_lanpr_active_line_layer_index_get(PointerRNA *ptr)
+{
+ SceneLANPR *lanpr = (SceneLANPR *)ptr->data;
+ LANPR_LineLayer *ls;
+ int i = 0;
+ for (ls = lanpr->line_layers.first; ls; ls = ls->next) {
+ if (ls == lanpr->active_layer) return i;
+ i++;
+ }
+ return 0;
+}
+
+void rna_lanpr_active_line_layer_index_set(PointerRNA *ptr, int value)
+{
+ SceneLANPR *lanpr = (SceneLANPR *)ptr->data;
+ LANPR_LineLayer *ls;
+ int i = 0;
+ for (ls = lanpr->line_layers.first; ls; ls = ls->next) {
+ if (i == value) {
+ lanpr->active_layer = ls;
+ return;
+ }
+ i++;
+ }
+ lanpr->active_layer = 0;
+}
+
+PointerRNA rna_lanpr_active_line_layer_get(PointerRNA *ptr)
+{
+ SceneLANPR *lanpr = (SceneLANPR *)ptr->data;
+ LANPR_LineLayer *ls = lanpr->active_layer;
+ return rna_pointer_inherit_refine(ptr, &RNA_LANPR_LineLayer, ls);
+}
+
+void rna_lanpr_active_line_layer_set(PointerRNA *ptr, PointerRNA value)
+{
+ SceneLANPR *lanpr = (SceneLANPR *)ptr->data;
+ lanpr->active_layer = value.data;
+}
+
#else
/* Grease Pencil Interpolation tool settings */
@@@ -2475,10 -2492,10 +2545,10 @@@ static void rna_def_tool_settings(Blend
prop = RNA_def_property(srna, "use_gpencil_thumbnail_list", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_THUMBNAIL_LIST);
RNA_def_property_ui_text(prop, "Compact List",
- "Show compact list of color instead of thumbnails");
+ "Show compact list of color instead of thumbnails");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
- prop = RNA_def_property(srna, "add_gpencil_weight_data", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_gpencil_weight_data_add", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_CREATE_WEIGHTS);
RNA_def_property_ui_text(prop, "Add weight data for new strokes",
"When creating new strokes, the weight data is added according to the current vertex group and weight, "
@@@ -5702,8 -5741,8 +5799,8 @@@ static void rna_def_scene_eevee(Blender
prop = RNA_def_property(srna, "use_sss_separate_albedo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSS_SEPARATE_ALBEDO);
RNA_def_property_boolean_default(prop, 0);
- RNA_def_property_ui_text(prop, "Separate Albedo", "Avoid albedo being blured by the subsurface scattering "
+ RNA_def_property_ui_text(prop, "Separate Albedo", "Avoid albedo being blurred by the subsurface scattering "
- "but uses more video memory");
+ "but uses more video memory");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
/* Screen Space Reflection */
More information about the Bf-blender-cvs
mailing list