Metasequoia BBS

| New message | Normal | Tree |
Status
Tag
Keyword
[5170] How to make child object in plugin code / nick
[Question] Response
Metasequoia 4.3.4, Win8.1 32bit, SDK 4.3.3, VS2013 Community Edition

I am writing an import plugin but cannot create child objects.

objclone->SetDepth(1) does set depth to 1 but depth is 0 after AddObject(objclone).

What am I doing wrong?

    MQObject obj = MQ_CreateObject();        
    // obj's vertices and faces are read from a file

    
    MQObject ob = MQ_CreateObject();
    doc->AddObject(ob); // add empty object
    
    for (int i = 0; i < 4; ++i)
    {
        MQObject objclone = obj->Clone();
        objclone->SetDepth(1);
        doc->AddObject(objclone); // objclone is not child of ob. Why?

Show more...
2015-01-26 12:34
[5171] Re: How to make child object in plugin code / Administrator
AddObject() erases an object's depth. Please call SetDepth() after AddObject().
2015-01-26 17:33
[5172] Re: How to make child object in plugin code / Nick
OK. Thank you.
2015-01-26 18:53