![]() |
Well. Did some code modifications and just could not get the proper out put!
Spent several days and wasted those days! Seems I Forgot that the basic code looks for a certain file in a very specific location! :/\\!! I haven't added the UI to select a file yet. :oops: Once I placed the file and named it properly? It worked perfectly. I've also to add a routine so one can select if this is for TDW's SH5 import or Skywas's S3D import. There are different things to consider for each. |
I did move the Code to Visual Studio 2010 Express C++.
Not sure if that is a smart move as yet but We will see. |
So, things are nearly finished ? :D
|
Quote:
Now I know that everything must be in the right order for us to be sure that UV2 coordinates are imported correctly in game. I know what I did wrong in the past and how to avoid those mistakes. Even so, the error is around the corner. A single, little mistake can mess up a whole UV map. For this reason, a program tracking down the most common causes of secondary UV map corruption, and correcting them where possible, would still be a valid help :yep: From this perspective, Blender is an useful editing and diagnostic tool, as it allows us to import the UV map from one model to another identical model. If the two models have the same geometry but v/vt sorted in a different order, it will be immediately apparent that the imported UV map is buggy, and so it will be in game. I think kapuhy exploited this feature, and this is why he never had similar problems importing his AO-mapped units in game. Nonetheless, Blender can't debug wrong AO models created with other programs, and this is where Almagest might show its AutoMagic powers :|\\ :D Quote:
There is a con to Blender-exported obj files though. If memory serves, GR2 Editor doesn't recognize one of the ASCII character it uses as line separator. If you open one of those files in Mircrosoft notepad you will immediately notice the difference as all the lines are shown one after the other, as if they were in the same paragraph. For GR2 Editor to read those files one needs to export/re-export the files in another program, or Notepad++ must be used to replace one character with the other. Kapuhy might know more on this topic. Quote:
|
On the differences of Wings and Blender files.
The hexadecimal 0a, a control character as opposed to a printing character, is called a line feed. The hexadecimal 0d is called a carriage return. Pretty much all the programs on the Windows platform understand and expect the hexadecimal 0a0d pair in text. The 0d0a pair of characters is the signal for the end of a line and beginning of another. Almagest accounts for that where TDW may not have caught that based on what files he was working with as test files. I've ran Wings files, Blender files, and 3d Max files through the basic code and all report proper out put. |
Quote:
Quote:
I was looking for the right words, but I missed them. Sorry for my bad phrasing and thank you for correcting it. Quote:
|
One thing I am doing is reading each line as a string. Not each section of that string like one would to import the obj format.
I'm not changing that information so strings should stay as in the obj file. All I'm doing is "Shuffling the cards" so to speak. Now that does involve "Stacking the deck" in areas but it works for our needs. :haha: |
Quote:
Quote:
If your excel sheet can solve the problem, let's try it. :up: Just explain to me how this works. :doh: |
I know from reading the other thread that a question was raised about how the information on mapping is stored in a dat file.
A dat with only 1 map channel is stored in a simple block of data. When We add say an AO channel? A TMAP section is added to the dat. I'll have to refresh my memory on how the TMAPs actually work since it's been so long since it had to be done by hex editing. (Pre 2007!) BUT! Only faces and texture coords are saved to the TMAP sections if I am recalling correctly. I actually still have a program from 'back in the day' that exports and imports the different TMAP channels. So one could change or add just a TMAP and not have to re-import the complete obj like S3D does. https://www.subsim.com/radioroom/pic...ictureid=12276 |
One thing I don't do is try to 'Guess' what went wrong.
Send me the files and I'll look at them. I've probably forgotten more then most people know. Not trying to be a smarmy butt head but I have been around the block more then once. |
Quote:
We are trying to understand why... |
Quote:
What for sure can mess up the order of sub-objects (and faces) is material assignation. The main model and the AO model should have materials with similar naming (Wings3D sorts them in alphabetical order) assigned to corresponding faces. If, for example, a group of faces in the main model is given a material whose name is let's say 'wood', the equivalent faces in the AO/UV2 object should be given a material named 'wood_AO', 'wood_2', or something similar. Quote:
Before I upload it, I need to be sure that it has enough rows for processing your model. Can you tell me the number of f and vt lines in the obj files you are processing? You can easily count them by pasting their content in an empty Excel document and by using the data filtering options or the COUNTIF function. Quote:
Does that mean that faces and texture coordinates can be in a different order in the secondary map channel than in the primary one? Quote:
|
Well that was easy.
I compared the main obj and the AO obj in 010. Your vertices do not match between the Main Hull and AO Hull. (I suspected that but as I said. I'll not play a guessing game) So anything else is going to be All screwed up on import! What S3D does when importing the Main diffuse object and the AO object is this! IF number counts are the same for the vertices? It ignores what those are in the AO object and only imports the faces and texture coords! So basically S3D IS importing garbage you created. That is the flaw AND the opening in S3D that I am working to fix! |
Quote:
2018 f 868 vt Hull1-uv2.obj : 2018 f 2729 vt It already seems problematic... :D [QUOTE=Jeff-Groves;2788565]Well that was easy. I compared the main obj and the AO obj in 010. Your vertices do not match between the Main Hull and AO Hull. Ah ! You replied while I was writting this... Quote:
Quote:
|
Well. In the dat file format you CAN HAVE different counts on that information!
But the VERTS MUST BE EXACTLY THE SAME! I'd suspect Wings re-ordered the Verts placement in the exported obj file thus faces and textures are screwed. And You are the one that used Wings. It didn't to it by itself! LOL! |
All times are GMT -5. The time now is 12:18 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.