[OPTing] XWA OPT Editor

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.
Post Reply

Re: [OPTing] XWA OPT Editor

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Dec 30, 2019 8:23 pm

The illumination is done by selecting which colors are illuminated.
You select a color (by clicking on the texture or via the combo box) and a tolerence. Then you click on Make illuminated".
You can see which part of the texture by selecting the palette 0 or by comparing the result on several palettes.

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Tue Jan 21, 2020 4:45 am

Getting this error again. Can't seem to find the errant file.

Everything appears to be either .png or .jpg at the moment (scratchhead)

Code: Select all

---------------------------
JeremyAnsel.Xwa.Opt
---------------------------
C:\Users\\Documents\Opting Files\Opts\Blender Working Files\t-85-x-wing\T85Xwing.obj

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: fileName
   at JeremyAnsel.Xwa.Opt.Texture.FromFile(String fileName, String fileNameAlpha, String fileNameIllum)
   at OptObjConverter.Converter.ObjToOpt(String objPath, Boolean scale)
   at XwaOptEditor.ViewModels.MainWindowViewModel.<ExecuteImportObjCommand>b__99_0(Action`1 dispatcher)
---------------------------
OK
---------------------------
I can also send you the files if you're able to fix whatever this error is. I'm not seeing the problem.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue Jan 21, 2020 9:42 am

Yes, you can send me the files.
This will help.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sun Apr 19, 2020 6:53 pm

Bug Report:

An8 export has inside-out models.

Open an opt, export to an8, open in an8 and all faces are inside-out, to fix select all and press shift+n

Can you fix the export to output normal faces?

Trev

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Tue Apr 21, 2020 4:45 am

Trevor you reminded me, will Steve's editor be able to import modern day .lwl LightWave, 3D Studio Max, blender, and other popular file formats for existing models?
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Tue Apr 21, 2020 10:45 am

At present no.
An8 supports

IN/OUT
obj, 3ds, stl (bin), lwo

OUT (using plugins from https://www.anim8or.com/smf/index.php/topic,1705.0.html)
c, Celestia (.cmod),Orbiter Mesh (.msh),Roblox (.mesh),VRML (.wrl),x

Trev

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Apr 29, 2020 2:51 pm

UPDATE

Hello,
I've updated XwaOptEditor.

Changelog:
- There is the mesh index in the meshes list.
- The exporters export flightgroup colors.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Apr 29, 2020 6:11 pm

Tried exporting an Awing.opt using 3dm twice, XwA Opt editor crashed both times

Code: Select all

Faulting application name: XwaOptEditor.exe, version: 1.0.77.0, time stamp: 0x5ea99144
Faulting module name: WindowsCodecs.dll, version: 6.2.9200.22551, time stamp: 0x5b8616b3
Exception code: 0xc0000005
Fault offset: 0x00000000001297a0
Faulting process id: 0x2dc4
Faulting application start time: 0x01d61e506d685fd9
Faulting application path: I:\&XWA\@XwaOptEditor\XwaOptEditor.exe
Faulting module path: C:\Windows\system32\WindowsCodecs.dll
Report Id: c0fac478-8a43-11ea-8019-001d7d002f67

Code: Select all

Application: XwaOptEditor.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
   at System.Drawing.SafeNativeMethods+Gdip.GdipSaveImageToFile(System.Runtime.InteropServices.HandleRef, System.String, System.Guid ByRef, System.Runtime.InteropServices.HandleRef)
   at System.Drawing.Image.Save(System.String, System.Drawing.Imaging.ImageCodecInfo, System.Drawing.Imaging.EncoderParameters)
   at JeremyAnsel.Xwa.Opt.Texture.Save(System.String)
   at OptRhinoConverter.Converter.OptToRhino(JeremyAnsel.Xwa.Opt.OptFile, System.String, Boolean)
   at XwaOptEditor.ViewModels.MainWindowViewModel.<ExecuteExportRhinoCommand>b__102_0(System.Action`1<System.Action>)
   at XwaOptEditor.Services.BusyIndicatorService+<>c__DisplayClass2_0.<Run>b__0()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Exporting to Obj didn't crash

Exporting to An8 Crashed

Code: Select all

Faulting application name: XwaOptEditor.exe, version: 1.0.77.0, time stamp: 0x5ea99144
Faulting module name: WindowsCodecs.dll, version: 6.2.9200.22551, time stamp: 0x5b8616b3
Exception code: 0xc0000005
Fault offset: 0x00000000001297a0
Faulting process id: 0xedc
Faulting application start time: 0x01d61e51018d3649
Faulting application path: I:\&XWA\@XwaOptEditor\XwaOptEditor.exe
Faulting module path: C:\Windows\system32\WindowsCodecs.dll
Report Id: 5968ed68-8a44-11ea-8019-001d7d002f67

Code: Select all

Application: XwaOptEditor.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
   at System.Drawing.SafeNativeMethods+Gdip.GdipSaveImageToFile(System.Runtime.InteropServices.HandleRef, System.String, System.Guid ByRef, System.Runtime.InteropServices.HandleRef)
   at System.Drawing.Image.Save(System.String, System.Drawing.Imaging.ImageCodecInfo, System.Drawing.Imaging.EncoderParameters)
   at JeremyAnsel.Xwa.Opt.Texture.Save(System.String)
   at OptAn8Converter.Converter.OptToAn8(JeremyAnsel.Xwa.Opt.OptFile, System.String, Boolean)
   at XwaOptEditor.ViewModels.MainWindowViewModel.<ExecuteExportAn8Command>b__104_0(System.Action`1<System.Action>)
   at XwaOptEditor.Services.BusyIndicatorService+<>c__DisplayClass2_0.<Run>b__0()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Apr 29, 2020 8:18 pm

UPDATE

I've updated XwaOptEditor.

Now you can save and replace the illumination of textures with ilumination maps.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Apr 29, 2020 9:33 pm

It's still crashing with the same errors I posted above

Is this a win7 thing?
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Thu Apr 30, 2020 12:04 am

The lightmap function works nice and easy but there are some issues ingame, cuased presumably by the MIP maps. With the new method, the illuminations are only loaded when you're getting really close, and then, in some cases they seem to load up face-by-face which looks extremely odd. If you check the images below, the engines are first unlit and only partially light up as I'm getting closer.
illumination1.png
illumination2.png
Also, is there anything to consider when creating the lightmaps? Do they need black or transparent background?
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Thu Apr 30, 2020 12:24 am

*Drool*…
That looks amazing!!! cant wait for it.

Trev

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Thu Apr 30, 2020 12:41 am

Nice. If you added a low level LOD mesh in the core with it's own E.G.'s, would that work in the transition ?
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Thu Apr 30, 2020 12:50 am

I'm not adding any more meshes or faces to this beast. Last I've deleted a whole bunch of them in an attempt to safe my framerate. Also, it wouldn't really help with the glowing windows, as you can see in the upper picture.
I think the solution has to be in the OPT. If you use "conventional" illumination à la OPTech or OPT Enhancer it works perfectly fine from any given distance.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Thu Apr 30, 2020 1:14 am

Trevor wrote:
Tue Apr 21, 2020 10:45 am
At present no.
An8 supports

IN/OUT
obj, 3ds, stl (bin), lwo

OUT (using plugins from https://www.anim8or.com/smf/index.php/topic,1705.0.html)
c, Celestia (.cmod),Orbiter Mesh (.msh),Roblox (.mesh),VRML (.wrl),x

Trev
Thanks for posting that link Trev. Will come in handy. Haven't been on his site for a year or two, but .obj format seemed to be the best universal format when bringing into XWAOptEditor from Anim8or. This is my favorite and easiest modeling program to use, and it's very precise. Only thing I can't stand is the texturing tools. Especially the UV wrapping circle and square tool. Applying textures and knowing how to scale them perfectly onto a mesh face is a pain for me. Wish someone could just create an easy stitching tool that allows you to zoom in and select/click or type the X,Z coordinates of a single pixel on an image file into a box, and then you choose which vertice on a mesh to staple that pixel location to. Then repeat for next 3 or 4 pixels to anchor your full image map precisely onto a mesh face or more. I've not seen any tools on net that can precisely and easily do this. And then scaling it; making image sharper or blurry once you have texture mapped on the mesh(es) the way you want.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Apr 30, 2020 12:15 pm

Darksaber wrote:
Wed Apr 29, 2020 9:33 pm
It's still crashing with the same errors I posted above

Is this a win7 thing?
It is not related to your system.
I'm able to reproduce the crash.
There is a bug in my opt library. I will fix it.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Apr 30, 2020 1:41 pm

I've updated XwaOptEditor.
Can you try if the crash still occurs?

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Apr 30, 2020 2:04 pm

General_Trageton wrote:
Thu Apr 30, 2020 12:04 am
Also, is there anything to consider when creating the lightmaps? Do they need black or transparent background?
Black pixels and transparent pixels are considered as not illuminated.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Thu Apr 30, 2020 2:13 pm

Obj and 3dm are fine now, they soon exported the files
An8 extracted and didn't crash but it took a lot longer than the other 2 to export the files, really slow
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Thu Apr 30, 2020 2:28 pm

JeremyaFr wrote:
Thu Apr 30, 2020 2:04 pm
General_Trageton wrote:
Thu Apr 30, 2020 12:04 am
Also, is there anything to consider when creating the lightmaps? Do they need black or transparent background?
Black pixels and transparent pixels are considered as not illuminated.
Do the lightmap images need to be monochrome or does it accept colors?
Also, any news on the mip mapping illumination distance issue?
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Apr 30, 2020 4:05 pm

Darksaber wrote:
Thu Apr 30, 2020 2:13 pm
An8 extracted and didn't crash but it took a lot longer than the other 2 to export the files, really slow
Fixed

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Apr 30, 2020 4:07 pm

General_Trageton wrote:
Thu Apr 30, 2020 2:28 pm
Do the lightmap images need to be monochrome or does it accept colors?
Also, any news on the mip mapping illumination distance issue?
It accepts colors in lightmaps. The alpha channel is used for illumination.

I will take a look to the distance issue.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Thu Apr 30, 2020 6:02 pm

JeremyaFr wrote:
Thu Apr 30, 2020 4:05 pm
Fixed
Just tested, much faster well done :)
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Thu Apr 30, 2020 11:54 pm

Thanks!
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri May 01, 2020 3:15 pm

UPDATE

Hello,
I've updated XwaOptEditor.
General_Trageton wrote:
Thu Apr 30, 2020 12:04 am
The lightmap function works nice and easy but there are some issues ingame, cuased presumably by the MIP maps. With the new method, the illuminations are only loaded when you're getting really close, and then, in some cases they seem to load up face-by-face which looks extremely odd. If you check the images below, the engines are first unlit and only partially light up as I'm getting closer.
Please retry.

Post Reply