Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_object.c
| Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | const EnumPropertyItem rna_enum_object_mode_items[] = { | ||||
| {OB_MODE_OBJECT, "OBJECT", ICON_OBJECT_DATAMODE, "Object Mode", ""}, | {OB_MODE_OBJECT, "OBJECT", ICON_OBJECT_DATAMODE, "Object Mode", ""}, | ||||
| {OB_MODE_EDIT, "EDIT", ICON_EDITMODE_HLT, "Edit Mode", ""}, | {OB_MODE_EDIT, "EDIT", ICON_EDITMODE_HLT, "Edit Mode", ""}, | ||||
| {OB_MODE_POSE, "POSE", ICON_POSE_HLT, "Pose Mode", ""}, | {OB_MODE_POSE, "POSE", ICON_POSE_HLT, "Pose Mode", ""}, | ||||
| {OB_MODE_SCULPT, "SCULPT", ICON_SCULPTMODE_HLT, "Sculpt Mode", ""}, | {OB_MODE_SCULPT, "SCULPT", ICON_SCULPTMODE_HLT, "Sculpt Mode", ""}, | ||||
| {OB_MODE_VERTEX_PAINT, "VERTEX_PAINT", ICON_VPAINT_HLT, "Vertex Paint", ""}, | {OB_MODE_VERTEX_PAINT, "VERTEX_PAINT", ICON_VPAINT_HLT, "Vertex Paint", ""}, | ||||
| {OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", ICON_WPAINT_HLT, "Weight Paint", ""}, | {OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", ICON_WPAINT_HLT, "Weight Paint", ""}, | ||||
| {OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""}, | {OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""}, | ||||
| {OB_MODE_PARTICLE_EDIT, "PARTICLE_EDIT", ICON_PARTICLEMODE, "Particle Edit", ""}, | {OB_MODE_PARTICLE_EDIT, "PARTICLE_EDIT", ICON_PARTICLEMODE, "Particle Edit", ""}, | ||||
| {OB_MODE_GPENCIL, "GPENCIL_EDIT", ICON_GREASEPENCIL, "Edit Strokes", "Edit Grease Pencil Strokes"}, | {OB_MODE_GPENCIL_EDIT, "GPENCIL_EDIT", ICON_EDITMODE_HLT, "Edit Mode", "Edit Grease Pencil Strokes"}, | ||||
| {OB_MODE_GPENCIL_SCULPT, "GPENCIL_SCULPT", ICON_SCULPTMODE_HLT, "Sculpt Mode", "Sculpt Grease Pencil Strokes"}, | |||||
| {OB_MODE_GPENCIL_WEIGHT, "GPENCIL_WEIGHT", ICON_WPAINT_HLT, "Weight Paint", "Grease Pencil Weight Paint Strokes"}, | |||||
| {OB_MODE_GPENCIL_PAINT, "GPENCIL_PAINT", ICON_GREASEPENCIL, "Draw", "Paint Grease Pencil Strokes"}, | |||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| const EnumPropertyItem rna_enum_object_empty_drawtype_items[] = { | const EnumPropertyItem rna_enum_object_empty_drawtype_items[] = { | ||||
| {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""}, | {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""}, | ||||
| {OB_ARROWS, "ARROWS", 0, "Arrows", ""}, | {OB_ARROWS, "ARROWS", 0, "Arrows", ""}, | ||||
| {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""}, | {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""}, | ||||
| {OB_CIRCLE, "CIRCLE", 0, "Circle", ""}, | {OB_CIRCLE, "CIRCLE", 0, "Circle", ""}, | ||||
| {OB_CUBE, "CUBE", 0, "Cube", ""}, | {OB_CUBE, "CUBE", 0, "Cube", ""}, | ||||
| {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""}, | {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""}, | ||||
| {OB_EMPTY_CONE, "CONE", 0, "Cone", ""}, | {OB_EMPTY_CONE, "CONE", 0, "Cone", ""}, | ||||
| {OB_EMPTY_IMAGE, "IMAGE", 0, "Image", ""}, | {OB_EMPTY_IMAGE, "IMAGE", 0, "Image", ""}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| const EnumPropertyItem rna_enum_object_gpencil_type_items[] = { | |||||
| { GP_EMPTY, "EMPTY", ICON_OUTLINER_OB_GPENCIL, "Empty", "" }, | |||||
| { GP_MONKEY, "MONKEY", ICON_MONKEY, "Monkey", "" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| static const EnumPropertyItem parent_type_items[] = { | static const EnumPropertyItem parent_type_items[] = { | ||||
| {PAROBJECT, "OBJECT", 0, "Object", "The object is parented to an object"}, | {PAROBJECT, "OBJECT", 0, "Object", "The object is parented to an object"}, | ||||
| {PARSKEL, "ARMATURE", 0, "Armature", ""}, | {PARSKEL, "ARMATURE", 0, "Armature", ""}, | ||||
| {PARSKEL, "LATTICE", 0, "Lattice", "The object is parented to a lattice"}, /* PARSKEL reuse will give issues */ | {PARSKEL, "LATTICE", 0, "Lattice", "The object is parented to a lattice"}, /* PARSKEL reuse will give issues */ | ||||
| {PARVERT1, "VERTEX", 0, "Vertex", "The object is parented to a vertex"}, | {PARVERT1, "VERTEX", 0, "Vertex", "The object is parented to a vertex"}, | ||||
| {PARVERT3, "VERTEX_3", 0, "3 Vertices", ""}, | {PARVERT3, "VERTEX_3", 0, "3 Vertices", ""}, | ||||
| {PARBONE, "BONE", 0, "Bone", "The object is parented to a bone"}, | {PARBONE, "BONE", 0, "Bone", "The object is parented to a bone"}, | ||||
| ▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | const EnumPropertyItem rna_enum_object_type_items[] = { | ||||
| OBTYPE_CU_CURVE, | OBTYPE_CU_CURVE, | ||||
| OBTYPE_CU_SURF, | OBTYPE_CU_SURF, | ||||
| {OB_MBALL, "META", 0, "Meta", ""}, | {OB_MBALL, "META", 0, "Meta", ""}, | ||||
| OBTYPE_CU_FONT, | OBTYPE_CU_FONT, | ||||
| {0, "", 0, NULL, NULL}, | {0, "", 0, NULL, NULL}, | ||||
| {OB_ARMATURE, "ARMATURE", 0, "Armature", ""}, | {OB_ARMATURE, "ARMATURE", 0, "Armature", ""}, | ||||
| {OB_LATTICE, "LATTICE", 0, "Lattice", ""}, | {OB_LATTICE, "LATTICE", 0, "Lattice", ""}, | ||||
| {OB_EMPTY, "EMPTY", 0, "Empty", ""}, | {OB_EMPTY, "EMPTY", 0, "Empty", ""}, | ||||
| {OB_GPENCIL, "GPENCIL", 0, "GPencil", ""}, | |||||
| {0, "", 0, NULL, NULL}, | {0, "", 0, NULL, NULL}, | ||||
| {OB_CAMERA, "CAMERA", 0, "Camera", ""}, | {OB_CAMERA, "CAMERA", 0, "Camera", ""}, | ||||
| {OB_LAMP, "LAMP", 0, "Lamp", ""}, | {OB_LAMP, "LAMP", 0, "Lamp", ""}, | ||||
| {OB_SPEAKER, "SPEAKER", 0, "Speaker", ""}, | {OB_SPEAKER, "SPEAKER", 0, "Speaker", ""}, | ||||
| {OB_LIGHTPROBE, "LIGHT_PROBE", 0, "Probe", ""}, | {OB_LIGHTPROBE, "LIGHT_PROBE", 0, "Probe", ""}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 260 Lines • ▼ Show 20 Lines | switch (ob->type) { | ||||
| case OB_FONT: return &RNA_Curve; | case OB_FONT: return &RNA_Curve; | ||||
| case OB_MBALL: return &RNA_MetaBall; | case OB_MBALL: return &RNA_MetaBall; | ||||
| case OB_LAMP: return &RNA_Lamp; | case OB_LAMP: return &RNA_Lamp; | ||||
| case OB_CAMERA: return &RNA_Camera; | case OB_CAMERA: return &RNA_Camera; | ||||
| case OB_LATTICE: return &RNA_Lattice; | case OB_LATTICE: return &RNA_Lattice; | ||||
| case OB_ARMATURE: return &RNA_Armature; | case OB_ARMATURE: return &RNA_Armature; | ||||
| case OB_SPEAKER: return &RNA_Speaker; | case OB_SPEAKER: return &RNA_Speaker; | ||||
| case OB_LIGHTPROBE: return &RNA_LightProbe; | case OB_LIGHTPROBE: return &RNA_LightProbe; | ||||
| case OB_GPENCIL: return &RNA_GreasePencil; | |||||
| default: return &RNA_ID; | default: return &RNA_ID; | ||||
| } | } | ||||
| } | } | ||||
| static void rna_Object_parent_set(PointerRNA *ptr, PointerRNA value) | static void rna_Object_parent_set(PointerRNA *ptr, PointerRNA value) | ||||
| { | { | ||||
| Object *ob = (Object *)ptr->data; | Object *ob = (Object *)ptr->data; | ||||
| Object *par = (Object *)value.data; | Object *par = (Object *)value.data; | ||||
| ▲ Show 20 Lines • Show All 615 Lines • ▼ Show 20 Lines | static void rna_MaterialSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| } | } | ||||
| static char *rna_MaterialSlot_path(PointerRNA *ptr) | static char *rna_MaterialSlot_path(PointerRNA *ptr) | ||||
| { | { | ||||
| Object *ob = (Object *)ptr->id.data; | Object *ob = (Object *)ptr->id.data; | ||||
| int index = (Material **)ptr->data - ob->mat; | int index = (Material **)ptr->data - ob->mat; | ||||
| /* from armature... */ | |||||
| return BLI_sprintfN("material_slots[%d]", index); | return BLI_sprintfN("material_slots[%d]", index); | ||||
| } | } | ||||
| /* why does this have to be so complicated?, can't all this crap be | /* why does this have to be so complicated?, can't all this crap be | ||||
| * moved to in BGE conversion function? - Campbell * | * moved to in BGE conversion function? - Campbell * | ||||
| * | * | ||||
| * logic from check_body_type() | * logic from check_body_type() | ||||
| * */ | * */ | ||||
| ▲ Show 20 Lines • Show All 593 Lines • ▼ Show 20 Lines | int rna_Camera_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) | ||||
| return ((Object *)value.id.data)->type == OB_CAMERA; | return ((Object *)value.id.data)->type == OB_CAMERA; | ||||
| } | } | ||||
| int rna_Lamp_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) | int rna_Lamp_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) | ||||
| { | { | ||||
| return ((Object *)value.id.data)->type == OB_LAMP; | return ((Object *)value.id.data)->type == OB_LAMP; | ||||
| } | } | ||||
| int rna_GPencil_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) | |||||
| { | |||||
| return ((Object *)value.id.data)->type == OB_GPENCIL; | |||||
| } | |||||
| int rna_DupliObject_index_get(PointerRNA *ptr) | int rna_DupliObject_index_get(PointerRNA *ptr) | ||||
| { | { | ||||
| DupliObject *dob = (DupliObject *)ptr->data; | DupliObject *dob = (DupliObject *)ptr->data; | ||||
| return dob->persistent_id[0]; | return dob->persistent_id[0]; | ||||
| } | } | ||||
| int rna_Object_use_dynamic_topology_sculpting_get(PointerRNA *ptr) | int rna_Object_use_dynamic_topology_sculpting_get(PointerRNA *ptr) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 1,558 Lines • Show Last 20 Lines | |||||