Layers util function to move objects around

This is required for outliner, so we can move an object from a collection into another
This commit is contained in:
Dalai Felinto 2017-03-10 18:12:47 +01:00
parent 6730202510
commit e9dd97405e
2 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,7 @@ void BKE_collection_object_add(struct Scene *scene, struct SceneCollection *sc,
void BKE_collection_object_add_from(struct Scene *scene, struct Object *ob_src, struct Object *ob_dst);
void BKE_collection_object_remove(struct Main *bmain, struct Scene *scene, struct SceneCollection *sc, struct Object *object, const bool free_us);
void BKE_collections_object_remove(struct Main *bmain, struct Scene *scene, struct Object *object, const bool free_us);
void BKE_collection_object_move(struct Main *bmain, struct Scene *scene, struct SceneCollection *sc_dst, struct SceneCollection *sc_src, struct Object *ob);
void BKE_collection_reinsert_after(const struct Scene *scene, struct SceneCollection *sc_reinsert, struct SceneCollection *sc_after);
void BKE_collection_reinsert_into(struct SceneCollection *sc_reinsert, struct SceneCollection *sc_into);

View File

@ -284,6 +284,15 @@ void BKE_collection_object_remove(Main *bmain, Scene *scene, SceneCollection *sc
}
}
/**
* Move object from a collection into another
*/
void BKE_collection_object_move(Main *bmain, Scene *scene, SceneCollection *sc_dst, SceneCollection *sc_src, Object *ob)
{
BKE_collection_object_add(scene, sc_dst, ob);
BKE_collection_object_remove(bmain, scene, sc_src, ob, false);
}
/**
* Remove object from all collections of scene
*/