8
$\begingroup$

From the Blender Python API:

unlink(object) Unlink object from scene

Parameters: object (Object, (never None)) – Object to remove from scene

Does the object directly get removed from the scene or rather the ObjectBase which links to the Object and hence the Object gets removed too?

$\endgroup$
0

1 Answer 1

6
$\begingroup$

It removes the object from that scene.

The reason the method is not called remove is that the object its self is not removed. Objects can exist in multiple scenes and groups. So scenes link to objects but don't store them (this is why you have bpy.data.objects).

The object-base is freed, mostly object-base is not exposed to the api, but in some cases accessing is important.

$\endgroup$
2
  • $\begingroup$ i'm interested in how blender works behind the python-api. can you point me to the c-source-file where the unlinking happens? $\endgroup$ Commented Sep 18, 2013 at 13:40
  • 1
    $\begingroup$ @ni-ko-o-kin, Scenes store a list of 'Base' types, DNA_scene_types.h, struct Scene.base is a linked list of Base types. scene.c has most functions for manipulating these. Search for sce->base in this file. $\endgroup$
    – ideasman42
    Commented Sep 18, 2013 at 22:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .