Python: Rename bpy.types.GreasePencilv3 to bpy.types.GreasePencil
This renames python Grease Pencil type from `bpy.types.GreasePencilv3` to `bpy.types.GreasePencil`. Part of #125058. Pull Request: https://projects.blender.org/blender/blender/pulls/146902
This commit is contained in:
committed by
Falk David
parent
80ccab6175
commit
f8d2a3af38
@@ -1212,7 +1212,7 @@ context_type_map = {
|
||||
"editable_fcurves": [("FCurve", True)],
|
||||
"fluid": [("FluidSimulationModifier", False)],
|
||||
"gpencil": [("GreasePencil", False)],
|
||||
"grease_pencil": [("GreasePencilv3", False)],
|
||||
"grease_pencil": [("GreasePencil", False)],
|
||||
"curves": [("Hair Curves", False)],
|
||||
"id": [("ID", False)],
|
||||
"image_paint_object": [("Object", False)],
|
||||
|
||||
@@ -2915,7 +2915,7 @@ class WM_OT_batch_rename(Operator):
|
||||
'CURVE': ("curves", iface_("Curve(s)"), bpy.types.Curve),
|
||||
'META': ("metaballs", iface_("Metaball(s)"), bpy.types.MetaBall),
|
||||
'VOLUME': ("volumes", iface_("Volume(s)"), bpy.types.Volume),
|
||||
'GREASEPENCIL': ("grease_pencils_v3", iface_("Grease Pencil(s)"), bpy.types.GreasePencilv3),
|
||||
'GREASEPENCIL': ("grease_pencils_v3", iface_("Grease Pencil(s)"), bpy.types.GreasePencil),
|
||||
'ARMATURE': ("armatures", iface_("Armature(s)"), bpy.types.Armature),
|
||||
'LATTICE': ("lattices", iface_("Lattice(s)"), bpy.types.Lattice),
|
||||
'LIGHT': ("lights", iface_("Light(s)"), bpy.types.Light),
|
||||
|
||||
@@ -441,7 +441,7 @@ class DATA_PT_grease_pencil_animation(DataButtonsPanel, PropertiesAnimationMixin
|
||||
|
||||
class DATA_PT_grease_pencil_custom_props(DataButtonsPanel, PropertyPanel, Panel):
|
||||
_context_path = "object.data"
|
||||
_property_type = bpy.types.GreasePencilv3
|
||||
_property_type = bpy.types.GreasePencil
|
||||
|
||||
|
||||
class GREASE_PENCIL_UL_attributes(UIList):
|
||||
|
||||
@@ -118,7 +118,7 @@ static wmOperatorStatus grease_pencil_layer_add_exec(bContext *C, wmOperator *op
|
||||
std::string new_layer_name = RNA_string_get(op->ptr, "new_layer_name");
|
||||
Layer &new_layer = grease_pencil.add_layer(new_layer_name);
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3, layers);
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencil, layers);
|
||||
|
||||
if (grease_pencil.has_active_layer()) {
|
||||
grease_pencil.move_node_after(new_layer.as_node(),
|
||||
@@ -190,7 +190,7 @@ static wmOperatorStatus grease_pencil_layer_remove_exec(bContext *C, wmOperator
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3Layers, active);
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3, layers);
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencil, layers);
|
||||
|
||||
DEG_id_tag_update(&grease_pencil.id, ID_RECALC_GEOMETRY);
|
||||
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, &grease_pencil);
|
||||
@@ -263,7 +263,7 @@ static wmOperatorStatus grease_pencil_layer_move_exec(bContext *C, wmOperator *o
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_DATA, &grease_pencil);
|
||||
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3, layers);
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencil, layers);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -344,7 +344,7 @@ static wmOperatorStatus grease_pencil_layer_group_add_exec(bContext *C, wmOperat
|
||||
|
||||
LayerGroup &new_group = grease_pencil.add_layer_group(new_layer_group_name);
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3, layer_groups);
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencil, layer_groups);
|
||||
|
||||
if (grease_pencil.has_active_layer()) {
|
||||
grease_pencil.move_node_after(new_group.as_node(),
|
||||
@@ -410,7 +410,7 @@ static wmOperatorStatus grease_pencil_layer_group_remove_exec(bContext *C, wmOpe
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3LayerGroup, active);
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3, layer_groups);
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencil, layer_groups);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -655,7 +655,7 @@ static wmOperatorStatus grease_pencil_layer_duplicate_exec(bContext *C, wmOperat
|
||||
active_layer, duplicate_frames, duplicate_drawings);
|
||||
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3, layers);
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencil, layers);
|
||||
|
||||
grease_pencil.move_node_after(new_layer.as_node(), active_layer.as_node());
|
||||
grease_pencil.set_active_layer(&new_layer);
|
||||
@@ -816,7 +816,7 @@ static wmOperatorStatus grease_pencil_merge_layer_exec(bContext *C, wmOperator *
|
||||
BKE_grease_pencil_nomain_to_grease_pencil(merged_grease_pencil, &grease_pencil);
|
||||
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3, layers);
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencil, layers);
|
||||
|
||||
/* Try to set the active (merged) layer. */
|
||||
TreeNode *node = grease_pencil.find_node_by_name(merged_layer_name);
|
||||
|
||||
@@ -1750,7 +1750,7 @@ float4x2 calculate_texture_space(const Scene *scene,
|
||||
GreasePencil *from_context(bContext &C)
|
||||
{
|
||||
GreasePencil *grease_pencil = static_cast<GreasePencil *>(
|
||||
CTX_data_pointer_get_type(&C, "grease_pencil", &RNA_GreasePencilv3).data);
|
||||
CTX_data_pointer_get_type(&C, "grease_pencil", &RNA_GreasePencil).data);
|
||||
|
||||
if (grease_pencil == nullptr) {
|
||||
Object *object = CTX_data_active_object(&C);
|
||||
|
||||
@@ -148,7 +148,7 @@ class LayerNodeDropTarget : public TreeViewItemDropTarget {
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3Layers, active);
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3, layers);
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencil, layers);
|
||||
}
|
||||
else if (drag_node.is_group()) {
|
||||
WM_msg_publish_rna_prop(CTX_wm_message_bus(C),
|
||||
@@ -157,7 +157,7 @@ class LayerNodeDropTarget : public TreeViewItemDropTarget {
|
||||
GreasePencilv3LayerGroup,
|
||||
active);
|
||||
WM_msg_publish_rna_prop(
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencilv3, layer_groups);
|
||||
CTX_wm_message_bus(C), &grease_pencil.id, &grease_pencil, GreasePencil, layer_groups);
|
||||
}
|
||||
|
||||
ED_undo_push(C, "Reorder Layers");
|
||||
|
||||
@@ -259,7 +259,7 @@ static bool buttons_context_path_data(ButsContextPath *path, int type)
|
||||
if (RNA_struct_is_a(ptr->type, &RNA_LightProbe) && ELEM(type, -1, OB_LIGHTPROBE)) {
|
||||
return true;
|
||||
}
|
||||
if (RNA_struct_is_a(ptr->type, &RNA_GreasePencilv3) && ELEM(type, -1, OB_GREASE_PENCIL)) {
|
||||
if (RNA_struct_is_a(ptr->type, &RNA_GreasePencil) && ELEM(type, -1, OB_GREASE_PENCIL)) {
|
||||
return true;
|
||||
}
|
||||
if (RNA_struct_is_a(ptr->type, &RNA_Curves) && ELEM(type, -1, OB_CURVES)) {
|
||||
@@ -1170,7 +1170,7 @@ int /*eContextResult*/ buttons_context(const bContext *C,
|
||||
return CTX_RESULT_OK;
|
||||
}
|
||||
if (CTX_data_equals(member, "grease_pencil")) {
|
||||
set_pointer_type(path, result, &RNA_GreasePencilv3);
|
||||
set_pointer_type(path, result, &RNA_GreasePencil);
|
||||
return CTX_RESULT_OK;
|
||||
}
|
||||
return CTX_RESULT_MEMBER_NOT_FOUND;
|
||||
|
||||
@@ -390,7 +390,7 @@ short RNA_type_to_ID_code(const StructRNA *type)
|
||||
if (base_type == &RNA_Annotation) {
|
||||
return ID_GD_LEGACY;
|
||||
}
|
||||
if (base_type == &RNA_GreasePencilv3) {
|
||||
if (base_type == &RNA_GreasePencil) {
|
||||
return ID_GP;
|
||||
}
|
||||
if (base_type == &RNA_Collection) {
|
||||
@@ -510,7 +510,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
|
||||
case ID_GD_LEGACY:
|
||||
return &RNA_Annotation;
|
||||
case ID_GP:
|
||||
return &RNA_GreasePencilv3;
|
||||
return &RNA_GreasePencil;
|
||||
case ID_GR:
|
||||
return &RNA_Collection;
|
||||
case ID_CV:
|
||||
|
||||
@@ -1426,7 +1426,7 @@ static void rna_def_grease_pencil_data(BlenderRNA *brna)
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
srna = RNA_def_struct(brna, "GreasePencilv3", "ID");
|
||||
srna = RNA_def_struct(brna, "GreasePencil", "ID");
|
||||
RNA_def_struct_sdna(srna, "GreasePencil");
|
||||
RNA_def_struct_ui_text(srna, "Grease Pencil", "Grease Pencil data-block");
|
||||
RNA_def_struct_ui_icon(srna, ICON_OUTLINER_DATA_GREASEPENCIL);
|
||||
|
||||
@@ -437,7 +437,7 @@ void RNA_def_main(BlenderRNA *brna)
|
||||
"Annotation data-blocks (legacy Grease Pencil)",
|
||||
RNA_def_main_annotations},
|
||||
{"grease_pencils_v3",
|
||||
"GreasePencilv3",
|
||||
"GreasePencil",
|
||||
"rna_Main_grease_pencils_begin",
|
||||
"Grease Pencil",
|
||||
"Grease Pencil data-blocks",
|
||||
|
||||
@@ -2131,14 +2131,14 @@ void RNA_def_main_grease_pencil(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
|
||||
/* return type */
|
||||
parm = RNA_def_pointer(
|
||||
func, "grease_pencil", "GreasePencilv3", "", "New Grease Pencil data-block");
|
||||
func, "grease_pencil", "GreasePencil", "", "New Grease Pencil data-block");
|
||||
RNA_def_function_return(func, parm);
|
||||
|
||||
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
||||
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||
RNA_def_function_ui_description(func,
|
||||
"Remove a Grease Pencil instance from the current blendfile");
|
||||
parm = RNA_def_pointer(func, "grease_pencil", "GreasePencilv3", "", "Grease Pencil to remove");
|
||||
parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "Grease Pencil to remove");
|
||||
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
||||
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
|
||||
RNA_def_boolean(
|
||||
|
||||
@@ -602,7 +602,7 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr)
|
||||
case OB_GPENCIL_LEGACY:
|
||||
return &RNA_Annotation;
|
||||
case OB_GREASE_PENCIL:
|
||||
return &RNA_GreasePencilv3;
|
||||
return &RNA_GreasePencil;
|
||||
case OB_CURVES:
|
||||
return &RNA_Curves;
|
||||
case OB_POINTCLOUD:
|
||||
|
||||
@@ -343,7 +343,7 @@ PyDoc_STRVAR(
|
||||
bpy_geometry_set_grease_pencil_doc,
|
||||
"The Grease Pencil data-block in the geometry set.\n"
|
||||
"\n"
|
||||
":type: :class:`bpy.types.GreasePencilv3`\n");
|
||||
":type: :class:`bpy.types.GreasePencil`\n");
|
||||
static PyObject *BPy_GeometrySet_get_grease_pencil(BPy_GeometrySet *self, void * /*closure*/)
|
||||
{
|
||||
return pyrna_id_CreatePyObject(
|
||||
|
||||
Reference in New Issue
Block a user