Compare commits
2 Commits
tmp-volume
...
temp-move-
Author | SHA1 | Date | |
---|---|---|---|
b3d15c05a9 | |||
4c6916402d |
@@ -29,10 +29,10 @@ set(INC_SYS
|
|||||||
)
|
)
|
||||||
|
|
||||||
set(SRC
|
set(SRC
|
||||||
geometry_attributes.c
|
geometry_attributes.cc
|
||||||
geometry_ops.c
|
geometry_ops.cc
|
||||||
|
|
||||||
geometry_intern.h
|
geometry_intern.hh
|
||||||
)
|
)
|
||||||
|
|
||||||
set(LIB
|
set(LIB
|
||||||
|
@@ -35,14 +35,14 @@
|
|||||||
|
|
||||||
#include "ED_object.h"
|
#include "ED_object.h"
|
||||||
|
|
||||||
#include "geometry_intern.h"
|
#include "geometry_intern.hh"
|
||||||
|
|
||||||
/*********************** Attribute Operators ************************/
|
/*********************** Attribute Operators ************************/
|
||||||
|
|
||||||
static bool geometry_attributes_poll(bContext *C)
|
static bool geometry_attributes_poll(bContext *C)
|
||||||
{
|
{
|
||||||
Object *ob = ED_object_context(C);
|
Object *ob = ED_object_context(C);
|
||||||
ID *data = (ob) ? ob->data : NULL;
|
ID *data = (ob) ? static_cast<ID *>(ob->data) : nullptr;
|
||||||
return (ob && !ID_IS_LINKED(ob) && data && !ID_IS_LINKED(data)) &&
|
return (ob && !ID_IS_LINKED(ob) && data && !ID_IS_LINKED(data)) &&
|
||||||
BKE_id_attributes_supported(data);
|
BKE_id_attributes_supported(data);
|
||||||
}
|
}
|
||||||
@@ -54,8 +54,8 @@ static bool geometry_attributes_remove_poll(bContext *C)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Object *ob = ED_object_context(C);
|
Object *ob = ED_object_context(C);
|
||||||
ID *data = (ob) ? ob->data : NULL;
|
ID *data = (ob) ? static_cast<ID *>(ob->data) : nullptr;
|
||||||
if (BKE_id_attributes_active_get(data) != NULL) {
|
if (BKE_id_attributes_active_get(data) != nullptr) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,22 +67,22 @@ static const EnumPropertyItem *geometry_attribute_domain_itemf(bContext *C,
|
|||||||
PropertyRNA *UNUSED(prop),
|
PropertyRNA *UNUSED(prop),
|
||||||
bool *r_free)
|
bool *r_free)
|
||||||
{
|
{
|
||||||
if (C == NULL) {
|
if (C == nullptr) {
|
||||||
return DummyRNA_NULL_items;
|
return DummyRNA_NULL_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object *ob = ED_object_context(C);
|
Object *ob = ED_object_context(C);
|
||||||
if (ob == NULL) {
|
if (ob == nullptr) {
|
||||||
return DummyRNA_NULL_items;
|
return DummyRNA_NULL_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rna_enum_attribute_domain_itemf(ob->data, r_free);
|
return rna_enum_attribute_domain_itemf(static_cast<ID *>(ob->data), r_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int geometry_attribute_add_exec(bContext *C, wmOperator *op)
|
static int geometry_attribute_add_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Object *ob = ED_object_context(C);
|
Object *ob = ED_object_context(C);
|
||||||
ID *id = ob->data;
|
ID *id = static_cast<ID *>(ob->data);
|
||||||
|
|
||||||
char name[MAX_NAME];
|
char name[MAX_NAME];
|
||||||
RNA_string_get(op->ptr, "name", name);
|
RNA_string_get(op->ptr, "name", name);
|
||||||
@@ -90,7 +90,7 @@ static int geometry_attribute_add_exec(bContext *C, wmOperator *op)
|
|||||||
AttributeDomain domain = (AttributeDomain)RNA_enum_get(op->ptr, "domain");
|
AttributeDomain domain = (AttributeDomain)RNA_enum_get(op->ptr, "domain");
|
||||||
CustomDataLayer *layer = BKE_id_attribute_new(id, name, type, domain, op->reports);
|
CustomDataLayer *layer = BKE_id_attribute_new(id, name, type, domain, op->reports);
|
||||||
|
|
||||||
if (layer == NULL) {
|
if (layer == nullptr) {
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,10 +144,10 @@ void GEOMETRY_OT_attribute_add(wmOperatorType *ot)
|
|||||||
static int geometry_attribute_remove_exec(bContext *C, wmOperator *op)
|
static int geometry_attribute_remove_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Object *ob = ED_object_context(C);
|
Object *ob = ED_object_context(C);
|
||||||
ID *id = ob->data;
|
ID *id = static_cast<ID *>(ob->data);
|
||||||
CustomDataLayer *layer = BKE_id_attributes_active_get(id);
|
CustomDataLayer *layer = BKE_id_attributes_active_get(id);
|
||||||
|
|
||||||
if (layer == NULL) {
|
if (layer == nullptr) {
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
|
|
@@ -25,6 +25,6 @@
|
|||||||
|
|
||||||
struct wmOperatorType;
|
struct wmOperatorType;
|
||||||
|
|
||||||
/* *** geometry_attributes.c *** */
|
/* *** geometry_attributes.cc *** */
|
||||||
void GEOMETRY_OT_attribute_add(struct wmOperatorType *ot);
|
void GEOMETRY_OT_attribute_add(struct wmOperatorType *ot);
|
||||||
void GEOMETRY_OT_attribute_remove(struct wmOperatorType *ot);
|
void GEOMETRY_OT_attribute_remove(struct wmOperatorType *ot);
|
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "ED_geometry.h"
|
#include "ED_geometry.h"
|
||||||
|
|
||||||
#include "geometry_intern.h"
|
#include "geometry_intern.hh"
|
||||||
|
|
||||||
/**************************** registration **********************************/
|
/**************************** registration **********************************/
|
||||||
|
|
Reference in New Issue
Block a user