PDA

View Full Version : Coffee: Remove()


laluneverte
02-24-2003, 01:05 PM
Hi all,

anybody out there who was able to explain
how it can be done to delete an object from
a document using coffee?

I think there is the remove() method in the
class BaseList2D, but I don't know how to
use it.

Looking forward to you replies,

regards,
Helge

H. Ikeda
02-25-2003, 01:23 PM
Hi,

Classes BaseList4D and BaseList2D stand for object hierarchy in the Object manager. SDK(R7) says that it removes the object from the list that it's currently attached to. So you can use Remove() function directly for an object, as follows:

obj->Remove();

for an object obj.

Then the problem is now how to specify an object. There are some cases.
1) Getting the first object in the Object manager.

var obj = doc->GetFirstObject();

2) Finding an object as its name from the document.

var obj = doc->FindObject("name");

3) Getting an active object from the document (first active object in R8).

var obj = GetActiveObject(doc);

Anyway, you'll have to make a plugin to remove many objects, and in the case of several objects to be removed, you can use delete command in the usual c4d way.

But I'm now thinking about a new script system, which I call 'Instant COFFEE'.
Using COFFEE-like but very much simplified script, we may have some commands for c4d, which are very restricted though. As a preview, you can see a state after two commands applied, as below. A prototype plugin will be created for conceptual understanding soon or later.:)

CGTalk Moderation
01-14-2006, 12:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.