Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_scene.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show All 33 Lines | |||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_layer_types.h" | #include "DNA_layer_types.h" | ||||
| #include "DNA_linestyle_types.h" | #include "DNA_linestyle_types.h" | ||||
| #include "DNA_userdef_types.h" | #include "DNA_userdef_types.h" | ||||
| #include "DNA_world_types.h" | #include "DNA_world_types.h" | ||||
| #include "DNA_gpencil_types.h" | #include "DNA_gpencil_types.h" | ||||
| #include "DNA_view3d_types.h" | #include "DNA_view3d_types.h" | ||||
| #include "DNA_screen_types.h" /* TransformOrientation */ | #include "DNA_screen_types.h" /* TransformOrientation */ | ||||
| #include "DNA_lanpr_types.h" | |||||
| #include "IMB_imbuf_types.h" | #include "IMB_imbuf_types.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_string_utils.h" | #include "BLI_string_utils.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| ▲ Show 20 Lines • Show All 2,057 Lines • ▼ Show 20 Lines | const EnumPropertyItem *rna_TransformOrientation_itemf( | ||||
| RNA_enum_item_end(&item, &totitem); | RNA_enum_item_end(&item, &totitem); | ||||
| *r_free = true; | *r_free = true; | ||||
| return item; | return item; | ||||
| } | } | ||||
| /* 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_style_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_style_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_style_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 | #else | ||||
| /* Grease Pencil Interpolation tool settings */ | /* Grease Pencil Interpolation tool settings */ | ||||
| static void rna_def_gpencil_interpolate(BlenderRNA *brna) | static void rna_def_gpencil_interpolate(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| ▲ Show 20 Lines • Show All 4,004 Lines • ▼ Show 20 Lines | static void rna_def_scene_eevee(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "use_shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SHADOW_HIGH_BITDEPTH); | RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SHADOW_HIGH_BITDEPTH); | ||||
| RNA_def_property_boolean_default(prop, 0); | RNA_def_property_boolean_default(prop, 0); | ||||
| RNA_def_property_ui_text(prop, "High Bitdepth", "Use 32bit shadows"); | RNA_def_property_ui_text(prop, "High Bitdepth", "Use 32bit shadows"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| } | } | ||||
| static void rna_def_scene_lanpr(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| static const EnumPropertyItem DEBUG_rna_enum_lanpr_reload[] = { | |||||
| {0, "IDLE", ICON_MESH_CUBE, "Idle", "Idle"}, | |||||
aligorith: There's no need for the icons here, especially if you're only going to set them to all be the… | |||||
| {1, "RELOAD", ICON_MESH_CUBE, "RELOAD", "Force reload the scene"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| static const EnumPropertyItem rna_enum_lanpr_master_mode[] = { | |||||
| {LANPR_MASTER_MODE_DPIX, "DPIX", ICON_MESH_CUBE, "DPIX", "DPIX GPU edge calculation"}, | |||||
aligorithUnsubmitted Not Done Inline ActionsAt some point, it would be good to get feedback from the UI team (@venomgfx and @William Reynish (billrey)) about the names/labels used in the interface. Currently, it's unclear to most users what "DPIX", "Snake", and "Lanpr" mean. But this is all stuff that we can easily work on. aligorith: At some point, it would be good to get feedback from the UI team (@venomgfx and @billrey) about… | |||||
| {LANPR_MASTER_MODE_SNAKE, "SNAKE", ICON_MESH_CUBE, "Snake", "Image filter and GPU tracing method"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| static const EnumPropertyItem rna_enum_lanpr_enable_post_processing[] = { | |||||
| {LANPR_POST_PROCESSING_DISABLED, "DISABLED", ICON_MESH_CUBE, "Disabled", "LANPR does not compute anything"}, | |||||
| {LANPR_POST_PROCESSING_ENABLED, "ENABLED", ICON_MESH_CUBE, "Enabled", "LANPR will compute feature lines in image post processing"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| static const EnumPropertyItem rna_enum_lanpr_display_thinning_result[] = { | |||||
| {LANPR_POST_PROCESSING_DISABLED, "DISABLED", ICON_MESH_CUBE, "Edge Detection", "Display edge detector result"}, | |||||
| {LANPR_POST_PROCESSING_ENABLED, "ENABLED", ICON_MESH_CUBE, "Thinning", "Apply thinning filters for vector usage"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| static const EnumPropertyItem rna_enum_lanpr_use_same_taper[] = { | |||||
| {LANPR_USE_DIFFERENT_TAPER, "DISABLED", ICON_MESH_CUBE, "Different", "Use different taper value"}, | |||||
| {LANPR_USE_SAME_TAPER, "ENABLED", ICON_MESH_CUBE, "Same", "Use same taper value for both sides of the line"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| static const EnumPropertyItem rna_enum_lanpr_enable_tip_extend[] = { | |||||
| {LANPR_DISABLE_TIP_EXTEND, "DISABLED", ICON_MESH_CUBE, "Disable", "Do not extend curve tips"}, | |||||
| {LANPR_ENABLE_TIP_EXTEND, "ENABLED", ICON_MESH_CUBE, "Enable", "Extend curve tips to a user specified length"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| srna = RNA_def_struct(brna, "SceneLANPR", NULL); | |||||
| RNA_def_struct_sdna(srna, "SceneLANPR"); | |||||
| RNA_def_struct_ui_text(srna, "Scene LANPR Config", "LANPR global config"); | |||||
| prop = RNA_def_property(srna, "reloaded", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, DEBUG_rna_enum_lanpr_reload); | |||||
| RNA_def_property_enum_default(prop, 0); | |||||
| RNA_def_property_ui_text(prop, "Reload", "Reload the scene"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "master_mode", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_lanpr_master_mode); | |||||
| RNA_def_property_enum_default(prop, LANPR_MASTER_MODE_DPIX); | |||||
| RNA_def_property_ui_text(prop, "Master Mode", "Choose calculation mode for NPR Line"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "enable_vector_trace", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_lanpr_enable_post_processing); | |||||
| RNA_def_property_enum_default(prop, LANPR_POST_PROCESSING_DISABLED); | |||||
| RNA_def_property_ui_text(prop, "Enable Post Processing", "Draw image post processing line or not"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "display_thinning_result", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_lanpr_display_thinning_result); | |||||
| RNA_def_property_enum_default(prop, LANPR_POST_PROCESSING_DISABLED); | |||||
| RNA_def_property_ui_text(prop, "Display", "Display mode"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 0.001f); | |||||
| RNA_def_property_ui_text(prop, "Depth Clamp", "Depth clamp value for edge extraction"); | |||||
| RNA_def_property_ui_range(prop, 0.0, 0.01, 0.0001, 5); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_strength", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 800); | |||||
| RNA_def_property_ui_text(prop, "Depth Strength", "Depth strength value for edge extraction"); | |||||
| RNA_def_property_ui_range(prop, 0, 1000, 10, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "normal_clamp", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 2); | |||||
| RNA_def_property_ui_text(prop, "Normal Clamp", "Normal clamp value for edge extraction"); | |||||
| RNA_def_property_ui_range(prop, 0, 5, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "normal_strength", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 10); | |||||
| RNA_def_property_ui_text(prop, "Normal Strength", "Normal strength value for edge extraction"); | |||||
| RNA_def_property_ui_range(prop, 0, 20, 1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "line_thickness", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 2.0f); | |||||
| RNA_def_property_ui_text(prop, "Line Thickness", "Thickness of extracted line"); | |||||
| RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_width_influence", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 0.3f); | |||||
| RNA_def_property_ui_text(prop, "Width Influence", "Use camera distance to control line width."); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_width_curve", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 0.3f); | |||||
| RNA_def_property_ui_text(prop, "Width Curve", "Width curve"); | |||||
| RNA_def_property_ui_range(prop, -5.0f, 0.90f, 0.1, 1); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_alpha_influence", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 0.3f); | |||||
| RNA_def_property_ui_text(prop, "Alpha Influence", "Use camera distance to control line alpha."); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_alpha_curve", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 0.3f); | |||||
| RNA_def_property_ui_text(prop, "Alpha Curve", "alpha curve"); | |||||
| RNA_def_property_ui_range(prop, -5.0f, 0.90f, 0.1, 1); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "taper_left_distance", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 20.0f); | |||||
| RNA_def_property_ui_text(prop, "Distance Left", "Left side taper distance"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "taper_right_distance", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 20.0f); | |||||
| RNA_def_property_ui_text(prop, "Distance right", "Right side taper distance"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "taper_left_strength", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Strength left", "Left side taper strength"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "taper_right_strength", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Strength right", "Right side taper strength"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "use_same_taper", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_lanpr_use_same_taper); | |||||
| RNA_def_property_enum_default(prop, LANPR_USE_DIFFERENT_TAPER); | |||||
| RNA_def_property_ui_text(prop, "Taper", "Same/Different taper value"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "line_color", PROP_FLOAT, PROP_COLOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_array(prop, 4); | |||||
| RNA_def_property_ui_text(prop, "Line Color", "Drawing lines using this color"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "background_color", PROP_FLOAT, PROP_COLOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_array(prop, 4); | |||||
| RNA_def_property_ui_text(prop, "Background Color", "Background Color"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "enable_tip_extend", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_lanpr_enable_tip_extend); | |||||
| RNA_def_property_enum_default(prop, LANPR_DISABLE_TIP_EXTEND); | |||||
| RNA_def_property_ui_text(prop, "Extend Tips", "Extending tips of curves"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "extend_length", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Extend Length", "Extend lenght of curves"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "crease_threshold", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 0.5f); | |||||
| RNA_def_property_ui_text(prop, "Crease Threshold", "cosine value of face angle"); | |||||
| RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.01, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "crease_fade_threshold", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 0.5f); | |||||
| RNA_def_property_ui_text(prop, "Crease Fade", "cosine value of face angle"); | |||||
| RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.01, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| /* these shall go into LANPR_LineLayer */ | |||||
| prop = RNA_def_property(srna, "enable_crease", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_ui_text(prop, "Enable Crease", "Draw crease lines"); | |||||
| prop = RNA_def_property(srna, "enable_edge_mark", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_ui_text(prop, "Enable Edge Mark", "Draw edge marks"); | |||||
| prop = RNA_def_property(srna, "enable_material_seperate", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_ui_text(prop, "Enable Material Lines", "Draw material seperators"); | |||||
| prop = RNA_def_property(srna, "enable_intersection", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_ui_text(prop, "Enable intersection Lines", "Draw intersection lines"); | |||||
| /* these are also demonstrating purpose */ | |||||
| prop = RNA_def_property(srna, "crease_color", PROP_FLOAT, PROP_COLOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_array(prop, 4); | |||||
| RNA_def_property_ui_text(prop, "Crease Color", "Drawing crease lines using this color"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 2); | |||||
| prop = RNA_def_property(srna, "material_color", PROP_FLOAT, PROP_COLOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_array(prop, 4); | |||||
| RNA_def_property_ui_text(prop, "Material Line Color", "Drawing material seperate lines using this color"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 2); | |||||
| prop = RNA_def_property(srna, "edge_mark_color", PROP_FLOAT, PROP_COLOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_array(prop, 4); | |||||
| RNA_def_property_ui_text(prop, "Edge Mark Color", "Drawing edge marks using this color"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 2); | |||||
| prop = RNA_def_property(srna, "line_thickness_crease", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Line Thickness", "Thickness of crease line"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2); | |||||
| prop = RNA_def_property(srna, "line_thickness_material", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Line Thickness", "Thickness of material line"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2); | |||||
| prop = RNA_def_property(srna, "line_thickness_edge_mark", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Line Thickness", "Thickness of edge mark line"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2); | |||||
| /* here's the collection stuff.... */ | |||||
| prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); | |||||
| RNA_def_property_collection_sdna(prop, "SceneLANPR", "line_style_layers", NULL); | |||||
| RNA_def_property_struct_type(prop, "LANPR_LineLayer"); | |||||
| RNA_def_property_ui_text(prop, "Line Layers", "LANPR Line Layers"); | |||||
| /* this part I refered to gpencil's and freestyle's and it seems that there's no difference */ | |||||
| RNA_def_property_srna(prop, "LineLayers"); | |||||
| srna = RNA_def_struct(brna, "LineLayers", NULL); | |||||
| RNA_def_struct_sdna(srna, "SceneLANPR"); | |||||
| RNA_def_struct_ui_text(srna, "LANPR Line Layers", ""); | |||||
| /* this part when accessing in python using lanpr.layers.active_layer always return None */ | |||||
| prop = RNA_def_property(srna, "active_layer", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_struct_type(prop, "LANPR_LineLayer"); | |||||
| RNA_def_property_pointer_funcs(prop, "rna_lanpr_active_line_layer_get", "rna_lanpr_active_line_layer_set", NULL, NULL); | |||||
| RNA_def_property_ui_text(prop, "Active Line Layer", "Active line layer being displayed"); | |||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | |||||
| prop = RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_UNSIGNED); | |||||
| RNA_def_property_int_funcs(prop, "rna_lanpr_active_line_layer_index_get", | |||||
| "rna_lanpr_active_line_layer_index_set", | |||||
| "rna_lanpr_active_line_layer_index_range"); | |||||
| RNA_def_property_ui_text(prop, "Active Line Layer Index", "Index of active line layer slot"); | |||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | |||||
| } | |||||
| void RNA_def_scene(BlenderRNA *brna) | void RNA_def_scene(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| ▲ Show 20 Lines • Show All 431 Lines • ▼ Show 20 Lines | #endif | ||||
| RNA_def_property_struct_type(prop, "SceneDisplay"); | RNA_def_property_struct_type(prop, "SceneDisplay"); | ||||
| RNA_def_property_ui_text(prop, "Scene Display", "Scene display settings for 3d viewport"); | RNA_def_property_ui_text(prop, "Scene Display", "Scene display settings for 3d viewport"); | ||||
| /* EEVEE */ | /* EEVEE */ | ||||
| prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "SceneEEVEE"); | RNA_def_property_struct_type(prop, "SceneEEVEE"); | ||||
| RNA_def_property_ui_text(prop, "EEVEE", "EEVEE settings for the scene"); | RNA_def_property_ui_text(prop, "EEVEE", "EEVEE settings for the scene"); | ||||
| /* LANPR */ | |||||
| prop = RNA_def_property(srna, "lanpr", PROP_POINTER, PROP_NONE); | |||||
| //RNA_def_property_pointer_sdna(prop, NULL, "lanpr"); | |||||
| RNA_def_property_struct_type(prop, "SceneLANPR"); | |||||
| RNA_def_property_ui_text(prop, "LANPR", "LANPR settings for the scene"); | |||||
| /* Nestled Data */ | /* Nestled Data */ | ||||
| /* *** Non-Animated *** */ | /* *** Non-Animated *** */ | ||||
| RNA_define_animate_sdna(false); | RNA_define_animate_sdna(false); | ||||
| rna_def_tool_settings(brna); | rna_def_tool_settings(brna); | ||||
| rna_def_gpencil_brush(brna); | rna_def_gpencil_brush(brna); | ||||
| rna_def_gpencil_interpolate(brna); | rna_def_gpencil_interpolate(brna); | ||||
| rna_def_unified_paint_settings(brna); | rna_def_unified_paint_settings(brna); | ||||
| rna_def_curve_paint_settings(brna); | rna_def_curve_paint_settings(brna); | ||||
| rna_def_statvis(brna); | rna_def_statvis(brna); | ||||
| rna_def_unit_settings(brna); | rna_def_unit_settings(brna); | ||||
| rna_def_scene_image_format_data(brna); | rna_def_scene_image_format_data(brna); | ||||
| rna_def_transform_orientation(brna); | rna_def_transform_orientation(brna); | ||||
| rna_def_selected_uv_element(brna); | rna_def_selected_uv_element(brna); | ||||
| rna_def_display_safe_areas(brna); | rna_def_display_safe_areas(brna); | ||||
| rna_def_scene_display(brna); | rna_def_scene_display(brna); | ||||
| rna_def_scene_eevee(brna); | rna_def_scene_eevee(brna); | ||||
| rna_def_scene_lanpr(brna); | |||||
| RNA_define_animate_sdna(true); | RNA_define_animate_sdna(true); | ||||
| /* *** Animated *** */ | /* *** Animated *** */ | ||||
| rna_def_scene_render_data(brna); | rna_def_scene_render_data(brna); | ||||
| rna_def_gpu_fx(brna); | rna_def_gpu_fx(brna); | ||||
| rna_def_scene_render_view(brna); | rna_def_scene_render_view(brna); | ||||
| /* Scene API */ | /* Scene API */ | ||||
| RNA_api_scene(srna); | RNA_api_scene(srna); | ||||
| } | } | ||||
| #endif | #endif | ||||
There's no need for the icons here, especially if you're only going to set them to all be the same