Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_relations.c
| Show First 20 Lines • Show All 945 Lines • ▼ Show 20 Lines | #endif | ||||
| uiItemBooleanO(layout, | uiItemBooleanO(layout, | ||||
| IFACE_("Object (Keep Transform Without Inverse)"), | IFACE_("Object (Keep Transform Without Inverse)"), | ||||
| ICON_NONE, | ICON_NONE, | ||||
| "OBJECT_OT_parent_no_inverse_set", | "OBJECT_OT_parent_no_inverse_set", | ||||
| "keep_transform", | "keep_transform", | ||||
| 1); | 1); | ||||
| struct { | struct { | ||||
| bool mesh, gpencil; | bool mesh, gpencil, curves; | ||||
| } has_children_of_type = {0}; | } has_children_of_type = {0}; | ||||
| CTX_DATA_BEGIN (C, Object *, child, selected_editable_objects) { | CTX_DATA_BEGIN (C, Object *, child, selected_editable_objects) { | ||||
| if (child == parent) { | if (child == parent) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (child->type == OB_MESH) { | if (child->type == OB_MESH) { | ||||
| has_children_of_type.mesh = true; | has_children_of_type.mesh = true; | ||||
| } | } | ||||
| if (child->type == OB_GPENCIL) { | if (child->type == OB_GPENCIL) { | ||||
| has_children_of_type.gpencil = true; | has_children_of_type.gpencil = true; | ||||
| } | } | ||||
| if (child->type == OB_CURVES) { | |||||
| has_children_of_type.curves = true; | |||||
| } | |||||
| } | } | ||||
| CTX_DATA_END; | CTX_DATA_END; | ||||
| if (parent->type == OB_ARMATURE) { | if (parent->type == OB_ARMATURE) { | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE); | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_NAME); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_NAME); | ||||
| if (!has_children_of_type.gpencil) { | if (!has_children_of_type.gpencil) { | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_ENVELOPE); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_ENVELOPE); | ||||
| } | } | ||||
| if (has_children_of_type.mesh || has_children_of_type.gpencil) { | if (has_children_of_type.mesh || has_children_of_type.gpencil) { | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_AUTO); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_AUTO); | ||||
| } | } | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_BONE); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_BONE); | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_BONE_RELATIVE); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_BONE_RELATIVE); | ||||
| } | } | ||||
| else if (parent->type == OB_CURVES_LEGACY) { | else if (parent->type == OB_CURVES_LEGACY) { | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_CURVE); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_CURVE); | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_FOLLOW); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_FOLLOW); | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_PATH_CONST); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_PATH_CONST); | ||||
| } | } | ||||
| else if (parent->type == OB_LATTICE) { | else if (parent->type == OB_LATTICE) { | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_LATTICE); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_LATTICE); | ||||
| } | } | ||||
| else if (parent->type == OB_MESH) { | |||||
| if (has_children_of_type.curves) { | |||||
| uiItemO(layout, "Object (Attach Curves to Surface)", ICON_NONE, "CURVES_OT_surface_set"); | |||||
| } | |||||
| } | |||||
| /* vertex parenting */ | /* vertex parenting */ | ||||
| if (OB_TYPE_SUPPORT_PARVERT(parent->type)) { | if (OB_TYPE_SUPPORT_PARVERT(parent->type)) { | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_VERTEX); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_VERTEX); | ||||
| uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_VERTEX_TRI); | uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_VERTEX_TRI); | ||||
| } | } | ||||
| UI_popup_menu_end(C, pup); | UI_popup_menu_end(C, pup); | ||||
| ▲ Show 20 Lines • Show All 1,734 Lines • Show Last 20 Lines | |||||