Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_vgroup.c
| Show First 20 Lines • Show All 2,458 Lines • ▼ Show 20 Lines | |||||
| /********************** vertex group operators *********************/ | /********************** vertex group operators *********************/ | ||||
| static int vertex_group_poll(bContext *C) | static int vertex_group_poll(bContext *C) | ||||
| { | { | ||||
| Object *ob = ED_object_context(C); | Object *ob = ED_object_context(C); | ||||
| ID *data = (ob) ? ob->data : NULL; | ID *data = (ob) ? ob->data : NULL; | ||||
| if ((ob) && (ob->type == OB_GPENCIL)) { | |||||
| return (ob && !ID_IS_LINKED_DATABLOCK(ob) && | |||||
| !ID_IS_LINKED_DATABLOCK(ob->gpd) && | |||||
| OB_TYPE_SUPPORT_VGROUP(ob->type) && | |||||
| ob->defbase.first); | |||||
| } | |||||
| else { | |||||
| return (ob && !ID_IS_LINKED_DATABLOCK(ob) && | return (ob && !ID_IS_LINKED_DATABLOCK(ob) && | ||||
| data && !ID_IS_LINKED_DATABLOCK(data) && | data && !ID_IS_LINKED_DATABLOCK(data) && | ||||
| OB_TYPE_SUPPORT_VGROUP(ob->type) && | OB_TYPE_SUPPORT_VGROUP(ob->type) && | ||||
| ob->defbase.first); | ob->defbase.first); | ||||
| } | } | ||||
| } | |||||
| static int vertex_group_supported_poll(bContext *C) | static int vertex_group_supported_poll(bContext *C) | ||||
| { | { | ||||
| Object *ob = ED_object_context(C); | Object *ob = ED_object_context(C); | ||||
| ID *data = (ob) ? ob->data : NULL; | ID *data = (ob) ? ob->data : NULL; | ||||
| if ((ob) && (ob->type == OB_GPENCIL)) { | |||||
| return (ob && !ID_IS_LINKED_DATABLOCK(ob) && OB_TYPE_SUPPORT_VGROUP(ob->type) && | |||||
| !ID_IS_LINKED_DATABLOCK(ob->gpd)); | |||||
| } | |||||
| else { | |||||
| return (ob && !ID_IS_LINKED_DATABLOCK(ob) && OB_TYPE_SUPPORT_VGROUP(ob->type) && | return (ob && !ID_IS_LINKED_DATABLOCK(ob) && OB_TYPE_SUPPORT_VGROUP(ob->type) && | ||||
| data && !ID_IS_LINKED_DATABLOCK(data)); | data && !ID_IS_LINKED_DATABLOCK(data)); | ||||
| } | } | ||||
| } | |||||
| static int vertex_group_mesh_poll(bContext *C) | static int vertex_group_mesh_poll(bContext *C) | ||||
| { | { | ||||
| Object *ob = ED_object_context(C); | Object *ob = ED_object_context(C); | ||||
| ID *data = (ob) ? ob->data : NULL; | ID *data = (ob) ? ob->data : NULL; | ||||
| return (ob && !ID_IS_LINKED_DATABLOCK(ob) && | return (ob && !ID_IS_LINKED_DATABLOCK(ob) && | ||||
| data && !ID_IS_LINKED_DATABLOCK(data) && | data && !ID_IS_LINKED_DATABLOCK(data) && | ||||
| ▲ Show 20 Lines • Show All 1,484 Lines • Show Last 20 Lines | |||||