FSIC Messageboard
  Old Tech Info
  obj export to ops /max script didnt work

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   obj export to ops /max script didnt work
Laika 801
Pilot
posted 01-15- 06:00 AM     Click Here to See the Profile for Laika 801   Click Here to Email Laika 801     Edit/Delete Message   Reply w/Quote

ok - this is what I got when I use the Max2Obj plugin without the scripts - the parts seem to be scaled correctly and textures are on (a bit to dark when lightning is on) - I still had to move the single parts per hand, but they are not wrong rotated.

When I use Bryans script(s) I get wrong scaled and 90 deg rotated parts with textures and als not in the right position.

sht!

SDOE didnt use my textures - why ?

Bryan - how can I get the script runnin?

IP: Logged

Laika 801
Pilot
posted 01-15- 09:23 AM     Click Here to See the Profile for Laika 801   Click Here to Email Laika 801     Edit/Delete Message   Reply w/Quote
forget to say that I allready moved the pivot points to the world origin and setting transformation and rotation to 0 0 0 and scale to 100 percent (every part/object of the model)

...

IP: Logged

JT
Pilot
posted 01-15- 10:31 AM     Click Here to See the Profile for JT   Click Here to Email JT     Edit/Delete Message   Reply w/Quote
Hi, Laika....

I just tried the script. The scale seems to be fine and the parts are in the correct orientation. The only problem is that the parts are scattered all over the place.
I'll let you know if have any breakthroughs.

IP: Logged

Laika 801
Pilot
posted 01-16- 02:47 AM     Click Here to See the Profile for Laika 801   Click Here to Email Laika 801     Edit/Delete Message   Reply w/Quote
Maybe it has something to do with the fact that I import my 3ds dos model into 3ds max - anyway - I can build the plane in OPS per hand but why didnt SDOE use my textures ?

IP: Logged

Bryan Russell
Pilot
posted 01-16- 05:11 AM     Click Here to See the Profile for Bryan Russell   Click Here to Email Bryan Russell     Edit/Delete Message   Reply w/Quote
The script basically resets the matrix of the MAX objects to the identity matrix, exports the files and then reverts it back to what it was before. Since Matrices include scaling as well as rotational and positioning information what could be happening is that you have scaled the objects at some stage and this is being reverted when the script is run.

I will be writing a full set of instructions for working with MAX and OPS, using the scripts and OPS import when I get the importing etc the way I want it.(It's close now, you're going to love the auto positioning thing )

One of the fundamental things is to get the object while in its default state, i.e. when its matrix is the identity matrix, the way you want it to export to OPS.

Basically when you do any rotation, positioning and scaling mirroring etc, at the object level you are just modifying the objects matrix, not the actual mesh. To prepare it for OPS you need to get the scale, rotation and position right without modifying the matrix. Once this is done you can do all of the rotating and moving at the object level without affecting the way the object is exported, if you are using the script. To do this you can follow the following proc.

Note that type in means type in the MAXScript listener window.

1. Type in 'old_mat = $.transform' to save the currently selected objects matrix

2. Type in '$.transform = matrix3 1' to revert the currently selected objects matrix to the identity matrix.

3. Using edit mesh and sub-object vertex, scale and rotate until it looks the way you want it. The positioning part is achieved by the pivot point so it’s not necessary to move the vertices now, although you could if you want.

4. Get out of vertex edit mode and type in ‘$.transform = old_mat’ to revert the object back to its old matrix. Now you might need to do some rotation etc at the object level to get it in the right place. Alternatively you could just forgo this step and just move it from the ‘default’ position.

The ‘$’ just means the selected object(s). You could replace this with $name to deal with a particular object explicitly.

You might think that the reset Xform util will do the same as ‘$.transform – matrix3 1’, but it doesn’t appear to

If you need to know anything else let me know.

I don't have any bright ideas for the texture thing. Its possible that since they are showing up in OPS OK (i looks like that from here anyway) that you are using a format not supported by SDOE. I pretty much included all the TIFF encoders I could find, but they are modular and SDOE may only have the ones they need.

Bryan


[This message has been edited by Bryan Russell (edited 01-16-2000).]

IP: Logged

Laika 801
Pilot
posted 01-16- 11:21 AM     Click Here to See the Profile for Laika 801   Click Here to Email Laika 801     Edit/Delete Message   Reply w/Quote
thanks bryan - I read your post but didnt understand it yet - you write something like "...auto positioning..." so is this not included yet? If so then everything with your export script is ok - I think I made a mistake in MAX.

Now I do it like this:

- select all objects

- under hierarchy/pivot point I reset the transform and scale (some objects imported from 3ds dos got a scale of 543 or so)

- set the rotation in the transformation type-in to 0 at all axis (with "affect pivot only" on)

- set the pivot points to the world origin (with "affect pivot only " on) in the transformation type-in

- now I got my model and every part is at 0 0 0 and scale is 100%

- when I export it to OPS all is fine (textures also) but the position of the single parts is wrong somehow (correct on the y-axis but spaced out somehow on the other axis (Wing test...))

ohh - the texture thing - I read SV´s docs and after that I extracted the sm file and looked into the asc file, thinking that something is wrong with the texture name or ID but this was ok. The only thing I found was that the texture flag wasn´t 802243 or 802223 (somewhat like 66A435 or so - I dont remember...). I changed the flag to 802223.
Then I build up the sm and deleted all the low-detail lods in my "test wing". After that the wing was shown correctly in SDOE. So the problem is either the incorrect flag of the textures or the low-detail lods (with the old P51D textures assigned).

I will read your post twice again and then I try to figure it out in max !

And please please please do this auto positioning thing for OPS (when I send you some money like pete hawk will you work faster )

thanks alot ! LK801

IP: Logged

Laika 801
Pilot
posted 01-16- 11:22 AM     Click Here to See the Profile for Laika 801   Click Here to Email Laika 801     Edit/Delete Message   Reply w/Quote
thanks bryan - I read your post but didnt understand it yet - you write something like "...auto positioning..." so is this not included yet? If so then everything with your export script is ok - I think I made a mistake in MAX.

Now I do it like this:

- select all objects

- under hierarchy/pivot point I reset the transform and scale (some objects imported from 3ds dos got a scale of 543 or so)

- set the rotation in the transformation type-in to 0 at all axis (with "affect pivot only" on)

- set the pivot points to the world origin (with "affect pivot only " on) in the transformation type-in

- now I got my model and every part is at 0 0 0 and scale is 100%

- when I export it to OPS all is fine (textures also) but the position of the single parts is wrong somehow (correct on the y-axis but spaced out somehow on the other axis (Wing test...))

ohh - the texture thing - I read SV´s docs and after that I extracted the sm file and looked into the asc file, thinking that something is wrong with the texture name or ID but this was ok. The only thing I found was that the texture flag wasn´t 802243 or 802223 (somewhat like 66A435 or so - I dont remember...). I changed the flag to 802223.
Then I build up the sm and deleted all the low-detail lods in my "test wing". After that the wing was shown correctly in SDOE. So the problem is either the incorrect flag of the textures or the low-detail lods (with the old P51D textures assigned).

I will read your post twice again and then I try to figure it out in max !

And please please please do this auto positioning thing for OPS (when I send you some money like pete hawk will you work faster ?)

thanks alot ! LK801

IP: Logged

Laika 801
Pilot
posted 01-16- 11:24 AM     Click Here to See the Profile for Laika 801   Click Here to Email Laika 801     Edit/Delete Message   Reply w/Quote
huh - whats goin on here ?

sorry for the 2nd posting - dont know what went wrong

IP: Logged

Bryan Russell
Pilot
posted 01-16- 05:08 PM     Click Here to See the Profile for Bryan Russell   Click Here to Email Bryan Russell     Edit/Delete Message   Reply w/Quote
Laika,

The best way I have found to get the object to the defult position/scale/rotation is to use the MAXScript listener as I described above. I havn't got much confidence in any of the reset XForms I've found. To get to the MAXScript listener choose the utilities rollout and then MAXScript. You will see the listner as option.

I just read a bit where you said "moved the pivot points to the world origin" I probably said something like this in another post somewhere, but it should read like this; The pivot point should be in the centre of the object, and then the whole object should be moved so that the pivot point is at the world origin. This is basically what the Script I wrote does, so when you use the script all you need to do is define the Pivot point correctly in the centre of the object. If you don't use the script then you will need to manually move each of the obejcts so the objects pivot point is at the world origin before you export.

Let me know if you have any more problems with it and I'll try to explain myself better.

The autopositiong thing is almost there. I'm still not happy with it but it works. Maybe I'll package it up and let you at it if you promise not to complain too much about it.


Bryan


IP: Logged

Laika 801
Pilot
posted 01-17- 05:21 AM     Click Here to See the Profile for Laika 801   Click Here to Email Laika 801     Edit/Delete Message   Reply w/Quote
P L E A S E ! ! !

...wont tell anything to anyone

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Fighter Squadron Information Center

(This site Copyright (c) 1999 Inertia LLC)

Powered by Infopop www.infopop.com © 2000
Ultimate Bulletin Board 5.45c