Cleanup: Object: remove unused BKE API.
This commit is contained in:
@@ -64,7 +64,6 @@ void BKE_object_free_particlesystems(struct Object *ob);
|
|||||||
void BKE_object_free_softbody(struct Object *ob);
|
void BKE_object_free_softbody(struct Object *ob);
|
||||||
void BKE_object_free_curve_cache(struct Object *ob);
|
void BKE_object_free_curve_cache(struct Object *ob);
|
||||||
|
|
||||||
void BKE_object_free(struct Object *ob);
|
|
||||||
void BKE_object_free_derived_caches(struct Object *ob);
|
void BKE_object_free_derived_caches(struct Object *ob);
|
||||||
void BKE_object_free_caches(struct Object *object);
|
void BKE_object_free_caches(struct Object *object);
|
||||||
|
|
||||||
@@ -111,7 +110,6 @@ typedef enum eObjectVisibilityResult {
|
|||||||
|
|
||||||
int BKE_object_visibility(const struct Object *ob, const int dag_eval_mode);
|
int BKE_object_visibility(const struct Object *ob, const int dag_eval_mode);
|
||||||
|
|
||||||
void BKE_object_init(struct Object *ob, const short ob_type);
|
|
||||||
struct Object *BKE_object_add_only_object(struct Main *bmain, int type, const char *name)
|
struct Object *BKE_object_add_only_object(struct Main *bmain, int type, const char *name)
|
||||||
ATTR_NONNULL(1) ATTR_RETURNS_NONNULL;
|
ATTR_NONNULL(1) ATTR_RETURNS_NONNULL;
|
||||||
struct Object *BKE_object_add(struct Main *bmain,
|
struct Object *BKE_object_add(struct Main *bmain,
|
||||||
@@ -135,12 +133,7 @@ struct Object *BKE_object_add_for_data(struct Main *bmain,
|
|||||||
void *BKE_object_obdata_add_from_type(struct Main *bmain, int type, const char *name)
|
void *BKE_object_obdata_add_from_type(struct Main *bmain, int type, const char *name)
|
||||||
ATTR_NONNULL(1);
|
ATTR_NONNULL(1);
|
||||||
|
|
||||||
void BKE_object_copy_data(struct Main *bmain,
|
|
||||||
struct Object *ob_dst,
|
|
||||||
const struct Object *ob_src,
|
|
||||||
const int flag);
|
|
||||||
struct Object *BKE_object_copy(struct Main *bmain, const struct Object *ob);
|
struct Object *BKE_object_copy(struct Main *bmain, const struct Object *ob);
|
||||||
void BKE_object_make_local(struct Main *bmain, struct Object *ob, const int flags);
|
|
||||||
bool BKE_object_is_libdata(const struct Object *ob);
|
bool BKE_object_is_libdata(const struct Object *ob);
|
||||||
bool BKE_object_obdata_is_libdata(const struct Object *ob);
|
bool BKE_object_obdata_is_libdata(const struct Object *ob);
|
||||||
|
|
||||||
|
@@ -470,9 +470,7 @@ bool BKE_lib_id_make_local(Main *bmain, ID *id, const bool test, const int flags
|
|||||||
BLI_assert(0);
|
BLI_assert(0);
|
||||||
return true;
|
return true;
|
||||||
case ID_OB:
|
case ID_OB:
|
||||||
if (!test) {
|
BLI_assert(0);
|
||||||
BKE_object_make_local(bmain, (Object *)id, flags);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
case ID_ME:
|
case ID_ME:
|
||||||
if (!test) {
|
if (!test) {
|
||||||
@@ -731,7 +729,7 @@ bool BKE_id_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int flag)
|
|||||||
BLI_assert(0);
|
BLI_assert(0);
|
||||||
break;
|
break;
|
||||||
case ID_OB:
|
case ID_OB:
|
||||||
BKE_object_copy_data(bmain, (Object *)*r_newid, (Object *)id, flag);
|
BLI_assert(0);
|
||||||
break;
|
break;
|
||||||
case ID_ME:
|
case ID_ME:
|
||||||
BKE_mesh_copy_data(bmain, (Mesh *)*r_newid, (Mesh *)id, flag);
|
BKE_mesh_copy_data(bmain, (Mesh *)*r_newid, (Mesh *)id, flag);
|
||||||
@@ -1351,11 +1349,9 @@ void BKE_libblock_init_empty(ID *id)
|
|||||||
case ID_LI:
|
case ID_LI:
|
||||||
/* Nothing to do. */
|
/* Nothing to do. */
|
||||||
break;
|
break;
|
||||||
case ID_OB: {
|
case ID_OB:
|
||||||
Object *ob = (Object *)id;
|
BLI_assert(0);
|
||||||
BKE_object_init(ob, OB_EMPTY);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case ID_ME:
|
case ID_ME:
|
||||||
BKE_mesh_init((Mesh *)id);
|
BKE_mesh_init((Mesh *)id);
|
||||||
break;
|
break;
|
||||||
@@ -2417,7 +2413,7 @@ void BKE_library_make_local(Main *bmain,
|
|||||||
else {
|
else {
|
||||||
/* we can switch the proxy'ing from the linked-in to the made-local proxy.
|
/* we can switch the proxy'ing from the linked-in to the made-local proxy.
|
||||||
* BKE_object_make_proxy() shouldn't be used here, as it allocates memory that
|
* BKE_object_make_proxy() shouldn't be used here, as it allocates memory that
|
||||||
* was already allocated by BKE_object_make_local() (which called BKE_object_copy). */
|
* was already allocated by object_make_local() (which called BKE_object_copy). */
|
||||||
ob_new->proxy = ob->proxy;
|
ob_new->proxy = ob->proxy;
|
||||||
ob_new->proxy_group = ob->proxy_group;
|
ob_new->proxy_group = ob->proxy_group;
|
||||||
ob_new->proxy_from = ob->proxy_from;
|
ob_new->proxy_from = ob->proxy_from;
|
||||||
|
@@ -143,7 +143,7 @@ void BKE_libblock_free_datablock(ID *id, const int UNUSED(flag))
|
|||||||
BKE_library_free((Library *)id);
|
BKE_library_free((Library *)id);
|
||||||
break;
|
break;
|
||||||
case ID_OB:
|
case ID_OB:
|
||||||
BKE_object_free((Object *)id);
|
BLI_assert(0);
|
||||||
break;
|
break;
|
||||||
case ID_ME:
|
case ID_ME:
|
||||||
BKE_mesh_free((Mesh *)id);
|
BKE_mesh_free((Mesh *)id);
|
||||||
|
@@ -782,12 +782,6 @@ void BKE_object_free_caches(Object *object)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Free (or release) any data used by this object (does not free the object itself). */
|
|
||||||
void BKE_object_free(Object *ob)
|
|
||||||
{
|
|
||||||
object_free_data(&ob->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* actual check for internal data, not context or flags */
|
/* actual check for internal data, not context or flags */
|
||||||
bool BKE_object_is_in_editmode(const Object *ob)
|
bool BKE_object_is_in_editmode(const Object *ob)
|
||||||
{
|
{
|
||||||
@@ -1026,6 +1020,22 @@ static const char *get_obdata_defname(int type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void object_init(Object *ob, const short ob_type)
|
||||||
|
{
|
||||||
|
object_init_data(&ob->id);
|
||||||
|
|
||||||
|
ob->type = ob_type;
|
||||||
|
|
||||||
|
if (ob->type != OB_EMPTY) {
|
||||||
|
zero_v2(ob->ima_ofs);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
|
||||||
|
ob->trackflag = OB_NEGZ;
|
||||||
|
ob->upflag = OB_POSY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void *BKE_object_obdata_add_from_type(Main *bmain, int type, const char *name)
|
void *BKE_object_obdata_add_from_type(Main *bmain, int type, const char *name)
|
||||||
{
|
{
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
@@ -1065,22 +1075,6 @@ void *BKE_object_obdata_add_from_type(Main *bmain, int type, const char *name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_object_init(Object *ob, const short ob_type)
|
|
||||||
{
|
|
||||||
object_init_data(&ob->id);
|
|
||||||
|
|
||||||
ob->type = ob_type;
|
|
||||||
|
|
||||||
if (ob->type != OB_EMPTY) {
|
|
||||||
zero_v2(ob->ima_ofs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
|
|
||||||
ob->trackflag = OB_NEGZ;
|
|
||||||
ob->upflag = OB_POSY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* more general add: creates minimum required data, but without vertices etc. */
|
/* more general add: creates minimum required data, but without vertices etc. */
|
||||||
Object *BKE_object_add_only_object(Main *bmain, int type, const char *name)
|
Object *BKE_object_add_only_object(Main *bmain, int type, const char *name)
|
||||||
{
|
{
|
||||||
@@ -1096,7 +1090,7 @@ Object *BKE_object_add_only_object(Main *bmain, int type, const char *name)
|
|||||||
id_us_min(&ob->id);
|
id_us_min(&ob->id);
|
||||||
|
|
||||||
/* default object vars */
|
/* default object vars */
|
||||||
BKE_object_init(ob, type);
|
object_init(ob, type);
|
||||||
|
|
||||||
return ob;
|
return ob;
|
||||||
}
|
}
|
||||||
@@ -1537,21 +1531,6 @@ void BKE_object_transform_copy(Object *ob_tar, const Object *ob_src)
|
|||||||
copy_v3_v3(ob_tar->scale, ob_src->scale);
|
copy_v3_v3(ob_tar->scale, ob_src->scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Only copy internal data of Object ID from source
|
|
||||||
* to already allocated/initialized destination.
|
|
||||||
* You probably never want to use that directly,
|
|
||||||
* use #BKE_id_copy or #BKE_id_copy_ex for typical needs.
|
|
||||||
*
|
|
||||||
* WARNING! This function will not handle ID user count!
|
|
||||||
*
|
|
||||||
* \param flag: Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).
|
|
||||||
*/
|
|
||||||
void BKE_object_copy_data(Main *bmain, Object *ob_dst, const Object *ob_src, const int flag)
|
|
||||||
{
|
|
||||||
object_copy_data(bmain, &ob_dst->id, &ob_src->id, flag);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* copy objects, will re-initialize cached simulation data */
|
/* copy objects, will re-initialize cached simulation data */
|
||||||
Object *BKE_object_copy(Main *bmain, const Object *ob)
|
Object *BKE_object_copy(Main *bmain, const Object *ob)
|
||||||
{
|
{
|
||||||
@@ -1829,11 +1808,6 @@ Object *BKE_object_duplicate(Main *bmain, const Object *ob, const int dupflag)
|
|||||||
return obn;
|
return obn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_object_make_local(Main *bmain, Object *ob, const int flags)
|
|
||||||
{
|
|
||||||
object_make_local(bmain, &ob->id, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Returns true if the Object is from an external blend file (libdata) */
|
/* Returns true if the Object is from an external blend file (libdata) */
|
||||||
bool BKE_object_is_libdata(const Object *ob)
|
bool BKE_object_is_libdata(const Object *ob)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user