Special Aircraft Service

The SAS Factory - Tech Help, Ancient Mods etc. => Tech Help : Making Mods => Tech Help (other than BAT or IL-2 Great Battles) => 3d Modding => Topic started by: SAS~Sani on November 03, 2010, 06:04:25 PM

Title: [Tutorial] Importing 3d models into IL2
Post by: SAS~Sani on November 03, 2010, 06:04:25 PM
I've never seen any practical/usefull importing tutorial,so I'll try to make one :)
This may not be the correct way to do it,but it works for me...meaning that
a couple of planes that I've imported work ok :),And it will be fairly simple
because this model doesn't have LOD's.

I will not go into 3d max techniques like mapping,adding materials or centering
pivots to object.I will assume that you know that and that your model is finished
and mapped.
Also I find it best that model is pointing in X direction in max viewport.

So,let's dig in,shall we? :).Subject of this tutorial is Spad VII
(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/0.jpg)


Let's start from the beggining,ie propeller.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/1.jpg)

First,center the pivot point to object.Then make a dummy object,place it like
in the picture and name it _Clip00.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/2.jpg)



This is a hook :).It goes from 00 to maximum of 60.Game uses these Clip hooks
to "know" where model is in game and to detect collisions.Also,game uses _Clip00
hook to determine in which direction model will fly.Make two clones of _Clip00,
and name them in numerical sequence (_Clip01,_Clip02).Position them at tips of
propblades.They will detect if you,for example,hit the ground with propeller
during take off.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/3.jpg)



Now we make a collision box,or hit box.This detects if bullets have hit the
propeller.Just make a simple shape (box) that roughly match propellers size.
Name it xxeng1prop and align it with propeller.Hit boxes must be converted to
editable mesh before export.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/4.jpg)



Next,shadow mesh.Select propeller model...clone it and name it SHW_Mesh.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/5.jpg)



Apply one of the unused default materials on this shadow...

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/6.jpg)



Now we need to link all this stuff to main propeller model.Go to schematics view
and connect clip hooks,collision box and shadow to main propeller model.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/7.jpg)


In reference coordinate system pick world,select main propeller mesh and write
down it's position (marked in red).This is important...marked part will be position
of propeller in hier.him file.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/8.jpg)


Next,move propeller into center of the viewport grid (X=0,Y=0,Z=0).

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/9.jpg)


And now you can export it with max exporter script.Go to Utilities/MAXScript,pick
Buggy Buggy IL2 Exporter...since this model doesn't have LOD's use only one
(I'm using 2000)....and that's it for the propeller :).

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/10.jpg)



I will update this tutorial as I progress with this plane,and hopefully I will cover entire aircraft...from importing all 3d stuff
to applying damage textures,overlay markings etc.Also I will explain how to customize java for this (moving parts,gauges etc)

Have fun :)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Anto on November 03, 2010, 08:53:57 PM
Thanks Sani, nice and clear. Definately cleared a few minor points up for me :)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Friction on November 03, 2010, 09:13:35 PM
Great tutorial! Answered quite a few of the questions I had!

Regards
James
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: ModdingMonkey on November 03, 2010, 09:24:55 PM
Me thinking this good.

:D
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Radar on November 04, 2010, 04:10:19 AM
Thanks mate
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: asheshouse on November 04, 2010, 04:15:10 AM
Very useful. Thanks
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Sani on November 04, 2010, 05:43:36 AM
The way I'm doing this is making text meshes for major parts of the plane,like
engine,fuselage,wings.Then put them in game and add details later.

Next part in line is engine cowling.Since you know now how to make shadows and
add hooks,here I will only show you how I would position clip hooks.Another important thing
is that pivot points need to be centered to object for every part you export.This
can be nightmarish later in him file,but it affects how parts fall of from the plane.
Meaning will they rotate normally or fly of in some weird trajectory.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/11.jpg)

Write down it's coordinates,move to center of the grid and export.


Fuselage.Or CF_D0.Every other part is linked to this one in him file.So,since it is
a center of aircraft,put his pivot point in center of max grid.

Hooks...we have a new one here..._ExternalBail01.Pilot will bail out from this hook.
(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/12.jpg)



Here we need to add collision boxes for cockpit and ammo.Name of the fuselage hit box
is xcf1...make it as a simple box that is roughly sized as fuselage mesh.Like this

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/13.jpg)

It will detect bullet hits to fuselage.


Next hit box is for cockpit.It should be named xcockpit,and size it to a cockpit size
in the fuselage.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/14.jpg)



Yet another hit box for ammo :).If this gets hit then bye bye ammo,gun jammed etc.
Since the (one) gun is belt fed,logical place for ammo box would be underneath the
gun.Name it xxammo01.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/15.jpg)



Connect everything in schematic view and export.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/16.jpg)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Sani on November 04, 2010, 06:44:49 AM
Tail.Usual stuff,center pivot (and write down it's coordinates),shadow,clip hooks.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/17.jpg)



Tail hit box is called xtail1,simple box shaped similarly to tail main mesh.Here we have
a few additional hit boxes....for tail spar,elevator and rudder controls.
Tail spar hit box should be named xxspart.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/18.jpg)


Since rudder and elevator are controled with wires,controls hit boxes are pretty small :)
Control box name is xxcontrols,and you can have a lot of them (xxcontrols1,xxcontrols2 etc).

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/19.jpg)


Fuel tank hit box...xxtank1.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/20.jpg)


Two new hooks here..._Tank1Burn and _Tank1Leak.I usually put leak hook on the bottom of fuselage
and burn hook inside fuel tank.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/21.jpg)


Connect everything to tail main model,move to center of grid and export.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: ModdingMonkey on November 04, 2010, 07:51:04 AM
actually with objects that do not move you dont have to move them to 0,0 it just makes them harder to align the other parts. :P

lol

in the heir file the last three numbers are just 0 0 0  that way.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Sani on November 04, 2010, 07:53:58 AM
Yes,but when tail gets shot off it flies away in a weird way,rotating around a point that is like 3m away from the actual object...and that's not looking good  :P

ALL parts in IL2 rotate around the center of max grid.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Docholiday on November 04, 2010, 07:59:58 AM
As newbee Your tutorial is worth gold for me !

Thank You

Doc  ;D
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Radar on November 04, 2010, 09:34:33 AM
As newbee Your tutorial is worth gold for me !

Thank You

Doc  ;D

+100

its gold for everyone who's looking for things known by most speakers and never explained :)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Sani on November 04, 2010, 12:41:54 PM
Two main parts are done,fuselage and tail...now landing gear and wheels so that it can stand
on it's own in game :)

I'll start with left wheel...make just shadow for it,center pivot to object (write down coordinates),
move to center of grid and export.Name exported mesh GearL1_Do.msh..

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/22.jpg)

Do the same with other wheel and name it GearR1_Do.msh.



Next is this gear strut.
(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/23.jpg)

Left wheel is linked to this strut.Also,we need to link _ClipLGear hook to it.
Put the hook just below the wheel where ground should be.Basically,airplane stands on
these hooks._ClipRGear is added the same way for the other wheel on other gear strut.

Hit boxes are named xgearl and xgearr...you can add more,just add number to it,like
xgearl1,xgearl2 etc.In this case I have xgearl,xgearl1,xgearr and xgearr1.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/24.jpg)


Struts also need their pivots centered to object and they need to be moved to center
before export.Name them GearR2_Do.msh and GearL2_Do.msh.


There is no tail wheel here,but if you have one,procedure is the same as with main gear,
_ClipCGear is linked to same part as tail wheel.Here I have only wooden stick,so it's
realy simple.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/25.jpg)

About pivot point...this part should rotate while plane is steering on the ground.See screenshot
how I have set it up (steering rotation is around Z axis).Hit box for tail gear is
xgearc1.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/26.jpg)

After seting up pivot point,write down it's coordinates,move to center and export,
name it GearC1_D0.msh.

Next,first tests in game ;)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~GJE52 on November 05, 2010, 03:29:52 AM
Quote
Yes,but when tail gets shot off it flies away in a weird way,rotating around a point that is like 3m away from the actual object...and that's not looking good 

ALL parts in IL2 rotate around the center of max grid.

Thanks Sani, this is a really great series .... and I never realised the above.... is that the reason I always have bits of my aircraft sitting up in the air after a crash ..... ?

G
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Sani on November 05, 2010, 07:57:33 AM
is that the reason I always have bits of my aircraft sitting up in the air after a crash ..... ?

Yes,depending how they fall on ground.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Sani on November 07, 2010, 09:20:38 AM
Ok,now we will try to get few parts in game ;)...first,make a new slot (unarmed),
or get someone to make it for you.Then,open him file of that new slot plane and
hide all parts (just add "hidden" for each part).Copy your new meshes (with materials and textures) to plane folder.
Since CF has pivot coordinates in center of max grid, it wil llook like this in him file:

[CF_D0]
Mesh CF_D0
Parent _ROOT_
Attaching 1 0 0 0 1 0 0 0 1 0 0 0
CollisionObject xcf1
CollisionObject .xcockpit
CollisionObject .xxammo1


You must list here hit boxes that you have made in max.Hit boxes that are within another hitbox have
"." infront of their name.

Tail will also be simple:

[Tail1_D0]
Mesh Tail_D0
Parent CF_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 -2.643 0 0
CollisionObject xtail1
CollisionObject .xxspart
CollisionObject .xxcontrols8
CollisionObject .xxcontrols9
CollisionObject .xxtank1


Parent mesh of tail is CF.This means that tail mesh will regard CF's pivot point as the center of max grid.
Since CF's pivot is actually in grid center,there is no math involved ;),so you can
just put in tail's max coordinates.

Same goes for EngineCowling mesh:

[EngineCowling]
Mesh EngineCowling
Parent CF_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 1.06 0 0


Just write in max coordinates...separable means that this part will fall off/fly away
if plane hits the ground or explodes in mid air.

Gear struts:

[GearL2_D0]
Mesh GearL2_D0
Parent CF_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 0.205 0.456 -0.778
CollisionObject xgearl
CollisionObject xgearl1
[GearR2_D0]
Mesh GearR2_D0
Parent CF_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 0.205 -0.459 -0.778
CollisionObject xgearr
CollisionObject xgearr1



And now wheels...here things get a bit more complex.Parent of left wheel is GearL2.
So wheel will regard GearL2's pivot as center of max grid...but problem is that GearL2
is not in center (it's parent is CF).Coordinates of the wheel in max are:

x     0.561
y     0.75
z    -1.13


and coordinates of GearL2 in max are

x     0.205
y     0.456
z    -0.778


So,to get IL2 coordinates of the wheel that has a GearL2 as parent,we must do this:

X axis wheelIL2 = X axis wheelMax - X axis GearL2Max

X = 0.561 - 0.205
X = 0.356


basically, new parts max coordinates minus parent's max coordinates equals new parts
IL2 coordinates.You must do this for all tree axis (X,Y,Z).So in the end you will get
this for left wheel:

[GearL1_D0]
Mesh GearL1_D0
Parent GearL2_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1  0.356 0.294 -0.352


and this for right wheel:

[GearR1_D0]
Mesh GearR1_D0
Parent GearR2_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 0.354 -0.295 -0.355


You need to do the same thing for GearC (wooden stick on the tail).For GearC we will
get this:

[GearC1_D0]
Mesh GearC1_D0
Parent Tail1_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 -1.148 0 -0.076
CollisionObject xgearc1




When you do this for the first time it looks pretty complicated,especialy if there is a
big "parent tree",but later on it get's easy.

So after all this we have few parts in game :)

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/27.jpg)
(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/28.jpg)
(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/29.jpg)

Now you can see if there are some smoothing issue or other problems that you don't
see in 3dmax.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Hawkman on November 08, 2010, 12:34:11 AM
Sani

Many thanks for taking the time to write and post this - this is a great help :)

Hawkers :)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Sani on November 09, 2010, 04:48:48 AM
Now I'm going to add that nice looking motor to it :).

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/30.jpg)

Shadow is added...and this is
list of hit boxes that I've used:

xengine1
xxeng1case
xxeng1cyls1
xxeng1cyls2
xxeng1oil1
xxoil1


Only hooks that needs to be added here are _Engine1Oil and _Engine1Smoke.Obviously,
oil and smoke come out of these when engine is hit :).After connecting all that to main model,
export...it's parent is CF so coordinates are same as in max.

[Engine1_D0]
Mesh Engine1_D0
Parent CF_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 0.62 0 0.087
CollisionObject xengine1
CollisionObject .xxeng1case
CollisionObject .xxeng1cyls1
CollisionObject .xxeng1cyls2
CollisionObject .xxeng1oil1
CollisionObject .xxoil1



Engine is parent of propeller that we already have...max coordinates of propeller are
x=1.256,y=0,z=0...motors coordinates are x=0.62,x=0,z=0.087...so after a little math we
get this for propeller:

[Prop1_D0]
Mesh Prop1_D0
Parent Engine1_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 0.636 0 -0.087
CollisionObject xxeng1prop


So,this is how it looks in game

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/31.jpg)
(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/32.jpg)

Here is a little twist...this propeller is rotating around wrong axis now.Default
rotation is around Y...right now propeller is orientated to rotate around X.I can fix this easily
by changing two digits of code....but for those that don't work with code,this is how you should
do it...open prop mesh in max.Move it to center and rotate it so that it faces in Y direction.

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/36.jpg)

Export it like that....if you start the game you might notice a small issue

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/33.jpg)


Start Kumpels matrix tool...you have rotated prop in max around Z axis by -90 degrees.
So,now you need to rotate it back into position with this tool....that means rotation of 90
degrees in positive direction:

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/34.jpg)

Now we need to change prop's him data to this

[Prop1_D0]
Mesh Prop1_D0
Parent Engine1_D0
Separable
Attaching 0 -1 0   1 0 0   0 0 1 0.636 0 -0.087
CollisionObject xxeng1prop


And now it looks and rotates ok :)

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/35.jpg)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Radar on November 23, 2010, 03:22:20 PM
Ok,now we will try to get few parts in game ;)...first,make a new slot (unarmed),
or get someone to make it for you.Then,open him file of that new slot plane and
hide all parts (just add "hidden" for each part).Copy your new meshes (with materials and textures) to plane folder.
Since CF has pivot coordinates in center of max grid, it wil llook like this in him file:

i'm quite late over this topic
you know i'm posting when i can, but i'm trying to do it in sorted form ;)

i just dont want to grab a cow for her nuts  :P
i'm doing some tries and not sure if i'm doing right

i sliced/merged my model the il2 needed way
after done that i prepared and ported some meshes as you so nicely described (the same i did with bombs)
i created my class and entries for weapons/plane.properties 

i got the following
- the whole 3D0/model folder has to be used or the game will hang over missing references in hier.him
- after copy to the 3d0/model folder my exported meshes the starting hier.him needs to be edited (linking/swaping new meshes , leaving hidden references to the old ones), overwriting when necessary (there must be one only "link" for each mesh)
- the "hidden-notation" is to put the "Hidden" keyword in every hier.him entry before the "Attaching" one

but what should i pay attention to if by example
i'm linking "CowlingPlate" mesh to a "CF_D0" where there's no "CowlingPlate" link  in the original hier.him file ?

isn't there a smart way to write the hier file from scratch ? maybe starting from the easiest aircraft,
i know many crafts are obtained extending a base class getting control of each variant mesh and behaviour
can't a simplier craft mean fewer links to mess with un/hiding ?

catch ya
S!
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Sani on November 23, 2010, 05:05:49 PM
You can make a him file from scratch,but you need to know what parts exactly are needed...


In your case just make new entrie fro CowlingMesh,but pay attention that parent is always before the "child" in him file (game reads it from top to bottom).
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Radar on November 24, 2010, 12:34:43 AM
You can make a him file from scratch,but you need to know what parts exactly are needed...
is exactly what i meant: ramble sources in search of "needed" parts sucks
and keep an aircraft made of 3 meshes should be easier than merge starting from a bigger one

Quote
In your case just make new entrie fro CowlingMesh,but pay attention that parent is always before the "child" in him file (game reads it from top to bottom).
i'll surely do more tries as i can, thanks for help mate
S!
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Radar on November 28, 2010, 06:02:39 AM
update...
please guys don't scare :) :)

i did  as described i'm putting together slices of a Ba65 one of us has made a gift of
unfortunately the model still needs to be sliced and uvw mapped but this will surely halp my learning curve ( i hope )

i'd like to use a neutral/monochromatic skin the way i can better see the model
but something strange happens when i create a 8bit tga skin for this need:
every time i enter the select craft GUI window the screen becomes black and i have to kill the application :|
any idea ?


SOLVED:  corrupted file skin1o.tga   
i strangely found this and some other tga dumped as 1x1px images :|
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: just champi on January 09, 2011, 07:03:28 AM
Hi, sani, and everyone,  :)
I've been messing around a little with importing and I find out that maybe we don't really need to do the math to calculate the position of the parts that have a parent wich is not in the 0,0,0 position. It may be a lot simpler than that.
As simple as just changing the reference coordinates system to "Parent" for those child parts, who's parent's are not in the center of grid. The coordenates you'll see in the bottom coordenates roll-out, are the ones of the part referred to his parent's pivot point, not the world center, so the ones you need to put in the him file for that part (the same that you obtain doing the math)

By the way, I use the method of typing in the Max Listener: $NameOfMesh.transform to obtain the matrix coordenates to all the parts in a previous step and make a .txt file with the info to later using the data for attaching in the hier.him editing step.

I hope it helps a bit when doing importing because it tends to be already a very time consuming task. :(
Maybe in the future some smart mate can write an script to automate at least a part of the whole process...

PD: I pray every night to the Lord above, to see some more episodes of your wonderful tutorial series some day... or at least seeing you, featuring a good thrilling solo in MTV channel... :-[  Just joking, thanks for what you already posted :P
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Sani on April 26, 2011, 01:21:31 PM
Well,this might seem little,in quantity,what I've posted here.But I think it covers enough to teach you how to import whole plane ;)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: just champi on April 29, 2011, 11:41:52 AM
yes! in fact, it was (for me) one of the more useful (and badly needed) tutorials about the matter and I really appreciatte it.  :)
I hope you have a great fun working the frets, Sani. Don't hesitate to put a link if you upload some other video performing some cool tune. I still (need to) enjoy my spanish Alhambra from time to time, so I think I understand quite well your point about devoting the little time you have, hurting your fingertips with your beloved passion. Enjoy it as much as you can!  8) ;D :P
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: valentini on December 06, 2014, 07:59:15 PM
Thanks for the tuto sani.

What i should do with the information that appears once you export the object from 3d max with buggy buggy????

1) I import the 3DMESH to 3d max ... OK
2) modify the 3d model .... OK
3) I use the buggy buggy to export .. What i do with the information on the MAX script listener ????

Thanks!!

(https://storebror.it.cx/sas/archive/sas2/EnsignRo/ImportingTutorial/10.jpg)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: S3231541 on December 06, 2014, 08:29:50 PM
you locate the .msh file that you imported/want to modify, copy the content of the file that you just generated. Copy everything and paste it into your .msh file. you should create backup of course.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Koty on December 14, 2015, 01:57:11 PM
So :))

I was trying to finally make the wingtips for MiG-21R, but I have a problem. I did one tip, then mirrored it and got the second one, mapped it, etc. Both tips were done the same way. Now - while the yellow entry (from picture below) works, the red does not. ...and I don't know where might be the problem. First I suspected a typo - but the names are right. So I wonder, where is the difference?! o.O

EDIT: That it does not work means that I can't access the model in IL's armament screen.


(http://s16.postimg.cc/gjs5i6alh/image.jpg) (http://postimg.cc/image/qh36b8i75/full/)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: western0221 on December 14, 2015, 02:00:48 PM
"HOW" don't work?

The aircraft is not shown up and some error line is recorded in the log?
 ... or ...
The aircraft is shown up and fly, no error line, but there is no wingtip you made?
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Koty on December 14, 2015, 02:05:40 PM
"HOW" don't work?

The aircraft is not shown up and some error line is recorded in the log?
 ... or ...
The aircraft is shown up and fly, no error line, but there is no wingtip you made?

When in QMB and I try clicking the most right button, it does nothing. If I use only "yellow", it opens. (Well - the "yellow" has some glitches - disappearing faces, but that is different thing.)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: western0221 on December 14, 2015, 02:10:43 PM
"HOW" don't work?

The aircraft is not shown up and some error line is recorded in the log?
 ... or ...
The aircraft is shown up and fly, no error line, but there is no wingtip you made?

When in QMB and I try clicking the most right button, it does nothing. If I use only "yellow", it opens. (Well - the "yellow" has some glitches - disappearing faces, but that is different thing.)

What error is recorded in opening QMB time with the red node?
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Koty on December 14, 2015, 02:21:03 PM
"HOW" don't work?

The aircraft is not shown up and some error line is recorded in the log?
 ... or ...
The aircraft is shown up and fly, no error line, but there is no wingtip you made?

When in QMB and I try clicking the most right button, it does nothing. If I use only "yellow", it opens. (Well - the "yellow" has some glitches - disappearing faces, but that is different thing.)

What error is recorded in opening QMB time with the red node?


Okay, I don't get it - after restarting the game - it works.
Mirracle.
I did not even change the lines. It did not work and now it works o.O ...I'm 19 and I'm already getting old for this.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: just champi on December 14, 2015, 02:56:16 PM
Don't know if it's of any help, or you already know, but making changes in Hier.him file, adding or substracting some part, needs restart of the game. If it's only editing one part, that was already there in him file, choosing another plane and choosing back yours make changes update.

Your Yellow wingtip shows that has a scaling applied in its attaching, I guess you already know and it's intentional. If that's not the case, there is an option in the Pivot tab, to reset scale when has been applied to a mesh.
It happened to me more than once that I forgot to check and the imported part was very small or very big...  :P
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Koty on December 14, 2015, 03:18:50 PM
Well, the fact is that in geometry we were learning how that matrix works, so... :D The problem wasn't the scale but QMB not accepting the other mesh being there. It should not need the game restart, only rendering enviroment - well, usually.


And now that that has been sorted out - the glitches...
As you can see, the outer half of the tip is missing. The inner half has no reflection. Any clues?

(http://s10.postimg.cc/ydd1iad8p/image.jpg) (http://postimg.cc/image/kjoot8kn9/full/)


Also - I've never happend upon Pivot tab when exporting... I have seen it here in the thread, but never on my own O.o
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: western0221 on December 14, 2015, 03:33:36 PM
About only aircraft standard external 3D,
in using the material "Gloss1D0o" the polygons are treated as single face, and
in using the material "Gloss2D0o" the polygons are treated as double face.

When that is single face, in looking the inverted polygon, it become transparent.
Only facing polygons are seen from the camera.

So accidently the polygons are inverted (flipped) , we see nothing there.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Koty on December 14, 2015, 03:47:37 PM
I tried the doublefacing, one half still missing. And the other is still transparent from the other side.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: just champi on December 14, 2015, 04:04:52 PM
Well, I'm not familiar with MIG 21 model, and really I can't tell what should I be seeing at the wingtips...
Just guessing, Western may be right and is an "only one side poly" issue.

Settings in 3dsMax Material editor apply inside max viewports, but don't have any effect in IL-2, so if you select doubleside material property it won't change anything... you need to actually build the two sides with polys.
Like in most 3d engine in Il-2 there is backface culling so you only see one side, the one facing the camera, to be able to see the other you need to put some triangles facing the other side..

But I bet it also has to do with the Symmetry modifier you applied.
Everytime you use Mirror to make symmetric parts, one half gets their axes inverted, and shows with normal faces inside out (the other one, with correct axes orientation shows right) .
To fix this you can apply a ResetXform modifier to the wrong half.
This will fix the inverted axes orientation ...but as a side effect, will make the faces or your mesh get inverted.
Then, to fix them, just select the offending ones and use Flip (inside EditMesh or EditPoly modifier) to restore back their normals.
 Be aware that ResetXForm, it also aligns the Local axes with World coordinates so if you have a part with their Local axes rotated (like with moving parts) you will need to rotate them back again...
Is always good idea to apply ResetXform before exporting, but be very careful, especially with animated parts, as after applying ResetXForm changes can't be undone!
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Koty on December 14, 2015, 04:17:35 PM
Well, I'm not familiar with MIG 21 model, and really I can't tell what should I be seeing at the wingtips...
Quote
It should be small object, shaped a bit like those droptanks.
But I bet it also has to do with the Symmetry modifier you applied.
Everytime you use Mirror to make symmetric parts, one half gets their axes inverted, and shows with normal faces inside out (the other one, with correct axes orientation shows right) .
Quote
THIS! Yes that explains it.


To fix this you can apply a ResetXform modifier to the wrong half.

Okay, will try.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Koty on December 15, 2015, 01:15:26 PM
Okay, solved. The problem was in scaling. I had to scale the object using Heir by 0.0254 - so I scaled the mesh itself and now I have 2.54 - all faces show, but they are too shiny (but at least the correct side is shiny). So I guess best is to keep it at 1. I'll have to figure how to scale properly in Max, but so far, solved.

EDIT: So, scaling wasn't that hard to do o.O
So, conclusion - if the scaling is 1>X>0, it gets lighting inverted. The more it is different from 1, the more intense the lighting is. If you get your cam too close - relative to original model, not the one scaled down by Hier - some faces are invisible.

I wish you a nice day.

Btw, if I figure how to correctly export from IL with keeping the mapping and if I manage to export it back... I might delete the stuff that has to be deleted and release it. Yeah, these things are just too complicated to me.
(http://s3.postimg.cc/f1sx2ges3/image.jpg) (http://postimg.cc/image/oz3xvimdr/full/)
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: western0221 on December 15, 2015, 01:28:36 PM
I'll have to figure how to scale properly in Max, but so far, solved.

I'm not sure your Max version's User Interface is as same as mine but....
 1. - In highlighting the object, mouse right click then menu tip is opened, and left click the box icon on the right of "Scale" menu. There is number input dialog. You can input "2.54%" and Enter, the object bacome smalled-down into 2.54%.
 2. - In highlighting the object, Push "R" short-cut-key or from menu-bar going Edit - Scale , then you can scaling by mouse left dragging up or down on the triangle highlight area.

After all, you have to use "XForm Reset" modifier and after it, "Collapse All" process.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Koty on December 15, 2015, 01:47:29 PM
Well, I just highlighted the object and typed directly into the number boxes down there. Worked. :)) I could not do that by dragging - I needed to input an exact number - can't do that by mouse... :)

But thanks anyway.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Storebror on December 16, 2015, 12:58:00 AM
Just want to add my $0.02 concerning hier.him scaling:
Don't do it.
By all means, don't.
Hier.him scaling causes all kinds of issues, from lighting issues over shadowing issues to inverted face issues.
Just don't do it, always use "1.0" scaling factor in hier him and instead resize your mesh if needed.

Best regards - Mike
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: Koty on December 16, 2015, 06:05:56 AM
Yeah, figured... what works however is the translation (last three numbers) - they do not cause any problems. Also from what I have seen rotation does not cause problems as well.
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: SAS~Storebror on December 16, 2015, 11:46:41 AM
That's correct.
The first 9 numbers span the coordinate system.
It can have any rotation of your choice, but each single vector (triple of numbers) has to have a length of 1.0, no matter which direction it points to.
The last triple is the position inside the coordinate system and that can take any numbers without issues.
You can move around meshes, hooks etc. as much as you like, just make sure the coordinate system vector lengths are 1.

Best regards - Mike
Title: Re: [Tutorial] Importing 3d models into IL2
Post by: just champi on December 16, 2015, 01:21:55 PM
I'm with Storebror regarding hier.him scaling

Do you want to take a look at the matrix in Max? try this:

-create a box of any dimensions and make it Edit Poly
-check the box matrix:
-hit F11 to open MaxScriptEditor and write:
 
 $nameofyourbox.transform

Code: [Select]
$Box001.transform
(matrix3 [1,0,0] [0,1,0] [0,0,1] [5.85897,3.1619,0])

-now scale your box and check again

  $nameofyourbox.transform

Code: [Select]
$Box001.transform
(matrix3 [2,0,0] [0,2,0] [0,0,2] [5.85897,3.1619,0])

Now find in the right command panel the hierarchy tab, and inside it the Pivot button.
There is a rollout in there called "Adjust transform"
and inside of it, at the bottom, the "Reset scale" button.
press that button and check again your matrix

$nameofyourbox.transform

Code: [Select]
$Box001.transform
(matrix3 [1,0,0] [0,1,0] [0,0,1] [5.85897,3.1619,0])

So its very easy to use Reset scale and don't have hier.him scaling

Also if you need to scale some whole object sometimes, try XForm modifier:

-add XForm modifier to your EditPoly box
-select gizmo sublevel
-scale the box
-check the matrix...

Code: [Select]
$Box001.transform
(matrix3 [1,0,0] [0,1,0] [0,0,1] [5.85897,3.1619,0])

no scaling!  8) it's like magic! :P