Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_object.c
| Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | const EnumPropertyItem rna_enum_object_mode_items[] = { | ||||
| ICON_SCULPTMODE_HLT, | ICON_SCULPTMODE_HLT, | ||||
| "Sculpt Mode", | "Sculpt Mode", | ||||
| "Sculpt Grease Pencil Strokes"}, | "Sculpt Grease Pencil Strokes"}, | ||||
| {OB_MODE_PAINT_GPENCIL, | {OB_MODE_PAINT_GPENCIL, | ||||
| "PAINT_GPENCIL", | "PAINT_GPENCIL", | ||||
| ICON_GREASEPENCIL, | ICON_GREASEPENCIL, | ||||
| "Draw", | "Draw", | ||||
| "Paint Grease Pencil Strokes"}, | "Paint Grease Pencil Strokes"}, | ||||
| {OB_MODE_VERTEX_GPENCIL, | |||||
| "VERTEX_GPENCIL", | |||||
| ICON_VPAINT_HLT, | |||||
| "Vertex Paint", | |||||
| "Grease Pencil Vertex Paint Strokes"}, | |||||
| {OB_MODE_WEIGHT_GPENCIL, | {OB_MODE_WEIGHT_GPENCIL, | ||||
| "WEIGHT_GPENCIL", | "WEIGHT_GPENCIL", | ||||
| ICON_WPAINT_HLT, | ICON_WPAINT_HLT, | ||||
| "Weight Paint", | "Weight Paint", | ||||
| "Grease Pencil Weight Paint Strokes"}, | "Grease Pencil Weight Paint Strokes"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| Show All 17 Lines | const EnumPropertyItem rna_enum_workspace_object_mode_items[] = { | ||||
| ICON_SCULPTMODE_HLT, | ICON_SCULPTMODE_HLT, | ||||
| "Grease Pencil Sculpt Mode", | "Grease Pencil Sculpt Mode", | ||||
| "Sculpt Grease Pencil Strokes"}, | "Sculpt Grease Pencil Strokes"}, | ||||
| {OB_MODE_PAINT_GPENCIL, | {OB_MODE_PAINT_GPENCIL, | ||||
| "PAINT_GPENCIL", | "PAINT_GPENCIL", | ||||
| ICON_GREASEPENCIL, | ICON_GREASEPENCIL, | ||||
| "Grease Pencil Draw", | "Grease Pencil Draw", | ||||
| "Paint Grease Pencil Strokes"}, | "Paint Grease Pencil Strokes"}, | ||||
| {OB_MODE_VERTEX_GPENCIL, | |||||
| "VERTEX_GPENCIL", | |||||
| ICON_VPAINT_HLT, | |||||
| "Grease Pencil Vertex Paint", | |||||
| "Grease Pencil Vertex Paint Strokes"}, | |||||
| {OB_MODE_WEIGHT_GPENCIL, | {OB_MODE_WEIGHT_GPENCIL, | ||||
| "WEIGHT_GPENCIL", | "WEIGHT_GPENCIL", | ||||
| ICON_WPAINT_HLT, | ICON_WPAINT_HLT, | ||||
| "Grease Pencil Weight Paint", | "Grease Pencil Weight Paint", | ||||
| "Grease Pencil Weight Paint Strokes"}, | "Grease Pencil Weight Paint Strokes"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Object *ob = (Object *)ptr->owner_id; | Object *ob = (Object *)ptr->owner_id; | ||||
| if (ob && ob->type == OB_GPENCIL) { | if (ob && ob->type == OB_GPENCIL) { | ||||
| /* notifying material property in topbar */ | /* notifying material property in topbar */ | ||||
| WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, NULL); | WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| } | } | ||||
| } | } | ||||
| static void rna_GPencil_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | |||||
| { | |||||
| Object *ob = (Object *)ptr->owner_id; | |||||
| if (ob && ob->type == OB_GPENCIL) { | |||||
| bGPdata *gpd = (bGPdata *)ob->data; | |||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_GEOMETRY); | |||||
| WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL); | |||||
| } | |||||
| } | |||||
| static void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) | static void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) | ||||
| { | { | ||||
| Object *ob = (Object *)ptr->owner_id; | Object *ob = (Object *)ptr->owner_id; | ||||
| BKE_object_matrix_local_get(ob, (float(*)[4])values); | BKE_object_matrix_local_get(ob, (float(*)[4])values); | ||||
| } | } | ||||
| static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) | static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 2,708 Lines • ▼ Show 20 Lines | # endif | ||||
| RNA_def_property_ui_text(prop, "Display Wire", "Add the object's wireframe over solid drawing"); | RNA_def_property_ui_text(prop, "Display Wire", "Add the object's wireframe over solid drawing"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); | RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); | ||||
| prop = RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAW_ALL_EDGES); | RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAW_ALL_EDGES); | ||||
| RNA_def_property_ui_text(prop, "Display All Edges", "Display all edges for mesh objects"); | RNA_def_property_ui_text(prop, "Display All Edges", "Display all edges for mesh objects"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); | RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); | ||||
| prop = RNA_def_property(srna, "use_grease_pencil_lights", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_USE_GPENCIL_LIGHTS); | |||||
| RNA_def_property_boolean_default(prop, true); | |||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | |||||
| RNA_def_property_ui_text(prop, "Use Lights", "Lights affect to grease pencil object"); | |||||
| RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "show_transparent", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_transparent", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWTRANSP); | RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWTRANSP); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Display Transparent", "Display material transparency in the object"); | prop, "Display Transparent", "Display material transparency in the object"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); | RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); | ||||
| prop = RNA_def_property(srna, "show_in_front", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_in_front", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY); | RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY); | ||||
| RNA_def_property_ui_text(prop, "In Front", "Make the object draw in front of others"); | RNA_def_property_ui_text(prop, "In Front", "Make the object draw in front of others"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); | RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_GPencil_update"); | ||||
| /* pose */ | /* pose */ | ||||
| prop = RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "poselib"); | RNA_def_property_pointer_sdna(prop, NULL, "poselib"); | ||||
| RNA_def_property_struct_type(prop, "Action"); | RNA_def_property_struct_type(prop, "Action"); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); | RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); | ||||
| RNA_def_property_ui_text(prop, "Pose Library", "Action used as a pose library for armatures"); | RNA_def_property_ui_text(prop, "Pose Library", "Action used as a pose library for armatures"); | ||||
| ▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines | |||||