Styler Posted November 29, 2014 Author Posted November 29, 2014 I found the way (taken from SDK) HChor *chor; HModelCache *hmc_new; HModel *working = hmc_new->NewInstance(chor); chor->InsertChildAtTail(working,TRUE); For some reason it hangs the app What I do: IEPolyModel* model = new IEPolyModel; // setting up model.. HModelCache *hmc = HModelCache::New("Foo", TRUE); hmc->MergeIEModel(model, "Foo", 0.0, TRUE, TRUE); delete model; HProject* prj = GetHProject(); if (HChorContainer* chors = prj->GetChildChorContainer()) { for (HHashObject* c = chors->GetChild(); c; c = c->GetSibling()) { HChor* chor = (HChor*)c; HModel* mdl = hmc->NewInstance(chor); chor->InsertChildAtTail(mdl, TRUE); } } Any ideas? Quote
Styler Posted November 29, 2014 Author Posted November 29, 2014 ok. after removing this line chor->InsertChildAtTail(mdl, TRUE); it start working as expected. Kind of understand why it behaves odd Quote
Hash Fellow robcat2075 Posted November 30, 2014 Hash Fellow Posted November 30, 2014 You're getting good at this! We expect to see some cool plugins some day! Quote
Styler Posted December 1, 2014 Author Posted December 1, 2014 I still have an issue. As I understood without chor->InsertChildAtTail(mdl, TRUE); model will be added, but with default settings. When I apply some transformations on brand new model it works only locally. After, in scene all values are equal zero. Actually start hating this shit =( Quote
Hash Fellow robcat2075 Posted December 1, 2014 Hash Fellow Posted December 1, 2014 When I apply some transformations on brand new model it works only locally. After, in scene all values are equal zero. Actually start hating this shit =( It works but then it doesn't? I'm not clear on when it stops working. With only one exception i can think of, changes made to a model in a chor do not ever affect the original model. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.