Styler
-
Posts
51 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Styler
-
-
ok. after removing this line
chor->InsertChildAtTail(mdl, TRUE);
it start working as expected. Kind of understand why it behaves odd
-
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?
-
Didn't get from SDK how to do it.
-
solved. i rewrote procedure
-
After bullding IEPolyModel from HModelCache I have HashArray m_attrlist of Attr objects. One of class members, as i correctly understood, contains material name Attr::char m_name [256]. In my case, with all correct materials groups, I have garbage in this buffer. Could somebody confirm what this is right way to get materials names?
-
-
Ok Rodney,
If so, could you rename this topic something like "How to access to clip image properties"
-
It's actually here. Thanks for hint
HDecalContainer* decals = hmc->GetChildDecalContainer(); if (decals) { for (HHashObject* _decal = decals->GetChild(); _decal; _decal = _decal->GetSibling()) { HDecal* decal = (HDecal*)_decal; HDecalClipContainer* clips = decal->GetChildDecalClipContainer(); if (clips) { for (HHashObject* _clip = clips->GetChild(); _clip; _clip = _clip->GetSibling()) { HClip* clip = (HClip*)_clip; HDecalClip* clipInfo = (HDecalClip*)_clip; UINT kind = clipInfo->GetKind()->GetValue(); // here is a type printf("- %s, type: <%d>\n", clip->GetMatchName().buf, kind); } } } }
-
-
Thanks Steffen, I already spotted infinite loop issue
-
Ughhh, I had error in function that set Magnitude for all control points. I didn't check for infinite loop when I was getting next CPS from spline. That's why it was freezing. Actually basic technique from 1 picture works fine now.
-
-
hmm... when i do extrusion of spline with 2 control points 2 times, shouldn't it be the same topology of patch model? it works fine for 1 patch. When i'm adding another one it causes an error
-
I'm trying to build IEPatchModel like on picture (just 2 patches), but Hash is freezing on stage:
hmc->MergeIEModel(model, "foo", 0.0, TRUE, TRUE);
Can somebody tell me how to do it properly? What I'm doing wrong? Thanks.Here is a source code:
void CreatePlane2() { float cps[] = { 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 2, 1, 0, 2, 0, 0 }; int faces4[] = { 0, 1, 2, 3, 3, 2, 4, 5 }; int numCps = 6; int numPatches = 2; // create model IEPatchModel* model = new IEPatchModel; for (int i = 0; i < numCps; i++) { model->m_vertexlist.Add(Vector(cps[i*3], cps[i*3 + 1], cps[i*3 + 2])); } // set up patches for (int i = 0; i < numPatches; i++) { IEPatch* patch = new IEPatch(NULL); model->m_patcharray.Add(patch); // sep patch indices for (int j = 0; j < 4; j++) { patch->m_vertexid[j] = faces4[i*4 + j]; } } HModelCache *hmc = HModelCache::New("plane"); hmc->MergeIEModel(model, "foo", 0.0, TRUE, TRUE); delete model; }
-
Does anybody know how to set In/Out Mantitude for control points in brand new created IEPatchModel object?
Let's say I want to create a new flat patch like quad poly
// create model IEPatchModel* model = new IEPatchModel; model->m_vertexlist.SetSize(4); model->m_vertexlist[0] = Vector(0, 0, 0); model->m_vertexlist[1] = Vector(1, 0, 0); model->m_vertexlist[2] = Vector(1, 1, 0); model->m_vertexlist[3] = Vector(0, 1, 0); // set up patches model->m_patcharray.SetSize(1); IEPatch* patch = new IEPatch(NULL); model->m_patcharray.SetAt(0, patch); // vxt index for (int i = 0; i < 4; i++) { patch->m_vertexid[i] = i; } HModelCache *hmc = HModelCache::New("plane"); hmc->MergeIEModel(model, "foo", 0.0, TRUE, TRUE);
Right now i have to set In/Out Mantitude after merging IEModel:
HSpline* sp = hmc->GetHeadSpline(); while (sp) { HCP* cp = sp->GetHeadCP(); while (cp) { cp->SetInMagnitude(0.0); cp->SetOutMagnitude(0.0); cp = cp->GetNext(); } sp = sp->GetNextSpline(); }
Can I set them up on stage of creation patch somehow?
-
Thanks Malo, very useful info!
-
thanks ill try this as well
-
ok, have some ideas. gonna use poly iterators, they have access to original patch. i can combine 4, 3 to back to 5 =)
-
Rob, i tried. it converts 5 exactly to 4, 3. See picture above with OBJ marker.
-
Thanks for information, Steffen!
I'm writing applink for 3DCoat and I faced with the problem that doing import/export process won't so simple, since Hash is purely spline-patch based app. As I understood you have great experience with Hash SDK. Could you tell me.. Do you know any other way to get polymesh than using BuildExportModel method? I'd like to get similar topology like patches have (4 or 5 points faces without forcing post-tesselation down to 4, 3). Thanks for your answers
-
Actually i found a bug in HModelCache class method
IEPolyModel *BuildExportModel(IEPolyModelParms *iemp, const char *modelmapfilename);
When it builds polymesh for model cache, it flips some face normals in 5 patches, sometimes. I suppose this is a bug in algorithm.surprisingly it works fine if i do export to OBJ, but for 3DS, LWO it doesn't work properly
-
I assume that help won't come =(
-
Danke Fuchur!
-
Thanks for quick response!
Since AM:SDK doesn't have any documentation, i could just guess what each class supposed to do =) from examples.
As I understood ModelCache is actually shape object, which holds topology information. Model - is instance of ModuleCache. I would like to save specific object back to mdl format after editing its topology. When i run plugin's dialog i have access to HTreeObject that i can cast to HModelCache and get access to its methods.The thing is - it's still reference to mdl file (not actually geometry).
How to jump inside mdl container?
In entry point in HxtOnCommand I have HTreeObject *htreeobject, with type of HOT_MODEL
then I execute CPluginApp dialog and casting this pointer to HModelCache*
// Here is code example:
HModelCache* shape = (HModelCache*)g_selectedTreeObject;
FileStream hs;
hs.Open(filename);
shape->Save(hs);
In beginning of output file i have:
LinkedModel=../Data/Models/Actors/Thom/Thom.mdl
Should be ModelFile container
...
How to add shortcut to Model into Chor
in Software Development Kit (SDK)
Posted
I still have an issue. As I understood without
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 =(