2 registered members (vicknick, AndrewAMD),
1,292
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: file_t.h
[Re: jcl]
#187440
03/10/08 13:43
03/10/08 13:43
|
Joined: May 2002
Posts: 7,441
ventilator
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2002
Posts: 7,441
|
thanks! wedpi_tools.cpp and wedpi_tools.h seem to be missing too in the january sdk. i had to copy them over from the november sdk. i have another problem. there seems to be a bug with fetching path skills. this is the part of wedpi_ExampleSaveLoad where the path skills get written: Code:
for ( i=0,n=0; i<points; i++) { fprintf(saveStc->fp, " "); for ( s=0; s<skills_pro_point; s++) { float skill=0; oEd->obje_GetObjData(OBJD_SKILL, n++, & skill, sizeof(float)); fprintf(saveStc->fp, "%f ", skill); } fprintf(saveStc->fp, "\n"); }
but it always outputs 0 for all skills! in my own project i didn't get it to work either.
|
|
|
Re: file_t.h
[Re: jcl]
#187443
03/14/08 15:04
03/14/08 15:04
|
Joined: Jul 2000
Posts: 27,986 Frankfurt
jcl
Chief Engineer
|
Chief Engineer
Joined: Jul 2000
Posts: 27,986
Frankfurt
|
Hier der Kommentar von Wladimir:
Die Funktion 'obje_GetObjData' funktioniert, d.h. liefert die Skills korrekt zurück.
for ( i=0; oEd->obje_GetObjData(OBJD_SKILL, i, & skill,sizeof(float)); i++) fprintf(saveStc->fp, "%f ", skill);
Mögliche Ursachen für den Fehler:
1. Falsches Edit-Interface: z.B. 'object_GetEditInterface()' liefert ein falsches Interface, wenn ein falsches Object (z.B. ein Block) selektiert ist.
CObjEditInterface * oEd = gp_WedInterface->object_GetEditInterface();
2. Oder bei richtigen Interface: Objekt kann nicht mit dem Intrface verbunden werden, z.B.:
bool cngGroupEnable = true; oEd->obje_SelectObjID(CurrObj.Id,cngGroupEnable) -
a) Object ist keine Entity b) Object ist Entity, liegt aber in einer Group, die nicht aktuell selektiert ist - 'cngGroupEnable' muss dann 'true' sein, um einen Group-Wechsel zu erlauben.
|
|
|
Re: file_t.h
[Re: jcl]
#187444
03/14/08 15:22
03/14/08 15:22
|
Joined: May 2002
Posts: 7,441
ventilator
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2002
Posts: 7,441
|
hm... wieso funktioniert es dann mit dem von wlad geschriebenen wmp export beispiel nicht? die skills sind in der exportierten wmp datei immer null. und ich verwende wie in wlads beispiel diese if-abfragen: Code:
CObjEditInterface *oEd = gp_WedInterface->object_GetEditInterface(); if(!oEd) { ASSERT(0); return; } if(!oEd->obje_SelectObjID(Obj.Id, true)) { ASSERT(0); return; }
CObjTrans ot; oEd->obje_GetTrans(&ot, true); // funktioniert!
CPathInfo path; oEd->obje_GetInfo(&path); // funktioniert!
...
for(i = 0, n = 0; i < numpoints; i++) { fprintf(fp, " "); for(s = 0; s < numskillsperpoint; s++) { float skill = 0; oEd->obje_GetObjData(OBJD_SKILL, n++, &skill, sizeof(float)); // funktioniert nicht! fprintf(fp, "%f ", skill); } fprintf(fp, "\n"); }
oEd scheint schon immer das korrekte pfad objekt zu sein, weil mit oEd->obje_GetTrans(); und oEd->obje_GetInfo(); bekomme ich die passenden informationen.
|
|
|
|