PDA

View Full Version : scenscan example - no Vmaps?



Jabba
04-21-2007, 11:47 AM
Hi there.

I'm having a bad times with scenscan example from LWSDK (Layout generic). It builds objectDB quite well, but when it comes to Vmaps, it don't contain any. I've got my test object with one TXUV map loaded in Layout and - nothign ;(

It's right from the box (clean unzipped SDK) and 9.0 Layout. I'ts something wrong on my side or this example simply don't work at all? ;)

Jabba
04-21-2007, 11:49 AM
I do a little debug and it seems that it fills only "base" vmap into odb...

Sensei
04-21-2007, 09:23 PM
Try debugging it.. put break-point in vmap.c file, getVertMapDB() function and check when it breaks..

Lightwolf
04-22-2007, 05:44 AM
Try debugging it..
I would have never expected to see you write something like this ;)

Cheers,
Mike

Jabba
04-22-2007, 08:58 AM
Try debugging it..
I love to, but i'm completely new to all this (LW SDK, MSVS and everything - I just tell to myself that it's time to move on higher level ;)). When I set the breakpoint, it seems ignored (until plugin crashed at some point).
It's quite off-topic, but if anybody could help me with MSVS2005 setting which tells LW to not ignore my breakpoints, I'll be happy...

Edit:

I do a little debug and it seems...
To be honest - it was just print into the file and some info requesters because of my problem described higher.

Lightwolf
04-22-2007, 09:01 AM
Create a debug build
Press F5 in MSVC (It will prompt you for a path to your exe, in this case either Layout or Modeler - and run it).

Now, once a breakpoint is hit you will return to the MSVC debugger.

Cheers,
Mike

Jabba
04-22-2007, 10:04 AM
Ah ;) Now I feels like complete idiot ;)

I read some helps how to connect LW to old versions of MSVS by -0 -c and mainly by -d parameter but it doesn't work for me. I then though that it's more complicated than just specifying the executable without params ;) Big thanks!

Jabba
04-22-2007, 11:01 AM
Could somebody correct me in this?

vmap.c - for cycle on ln175 / if(ismapped) on ln189
It seems, that vmap.c correctly scans for number of vertexmaps per objects by ismapped. For example, for one object with one TXUV, it scans in first cycle the "base" morph (ismapped = 0) and don't increment the nvmaps. In second cycle for TXUV it's mapped, so after that, the number in nvmaps is 1.

But then, it pass this nvmaps counter into other cycle on the line 210 when (imho) only assigned vmaps for this object should be processed, but it doesn't adress them and use found "nvmaps" count just as a number of cycles of its forcycle and check global vmaps by this index starting from zero.

simply:
1) 1 object in the layout with 1 TXUV
2) it gets [0] "base" and [1] "Texture" global vmap array
3) it test in the for cycle those two vmaps against all points in the object by ismapped function. It returns bunch of falses for [0]base vmaps and true for all points in [1]"Texture" test. So it fills 1 as a count of Vmaps used in the object.
4) it then do next for cycle when it gathers informations (values) from vmaps. It uses count of used Vmaps (1) as a nr of cycles but then it refer to [0]"base" Vmaps. If uses ismapped again so it fills nothing in the point>vmap values

I'm I right? Could, please, somebody check this sample provided in LW SDK? It's quite important for me, because I've got MSVS installed till friday ;). I decided to rewrite my LScript exporter to plugin and I'm quite not sure if all those crashes and not working code are just my and only my mistake ;)

I tried to wrote it from scratch but then I got completely lost in the forest of pointers to structures that points to functions that returns the pointers to somewhere, which LW SDK truely is ;( This Scenscan example seems like good startingpoint for me - but I need my UVs and I really don't know what's going on with that sample code ;(
Thanks for saving me ;)

Sensei
04-22-2007, 02:44 PM
If you don't need flexibility but just export one specified uv map with given name you can use LWMeshInfo function:

int (*pntVGet) (LWMeshInfoID, LWPntID, float *);

before scanning points/polygons call these:

void * (*pntVLookup) (LWMeshInfoID, LWID, const char *);
int (*pntVSelect) (LWMeshInfoID, void *);

const char * get from panel string control, or if it's tool just for you hardcode string name.. ;)

If there is more vmaps to scan, f.e. with bone influence, pntVLookup() them at init stage, and in point/poly scan call-back call pntVSelect() and pntVGet()..

It's all very easy.. Complexity starts when you need to export just everything, and you are not sure what export and what skip..

Jabba
04-23-2007, 03:45 AM
Thanks. I'll try this.

And what about my debugging conclusions? Am I right? Is that scenscan example bugged? I'm asking because if yes, it's still time to repair it untill the 9.2'll be released...