SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 01-23-14, 07:27 PM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

You know what I need to add to the import window? Whether you want the materials to be updated or not. Currently the importers always update the materials no matter what. If you only want to change the vertex data and nothing else then there's no reason to update the materials. I'll make that change
TheDarkWraith is offline   Reply With Quote
Old 01-23-14, 07:46 PM   #2
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
You know what I need to add to the import window? Whether you want the materials to be updated or not. Currently the importers always update the materials no matter what. If you only want to change the vertex data and nothing else then there's no reason to update the materials. I'll make that change
Quote:
Originally Posted by TheDarkWraith View Post
I see why your objects 'washed out'. It has to do with your MTL file for the Object13:

...

Since that mesh only had 1 subset the app used the first newmtl definition it found as the material properties for the mesh when it updated the materials. You have to be careful with Wings3D and materials. That 'default' material will always screw things up!

Once I finish adding the checkbox and code for whether you want the materials updated or not to the import window it will help alleviate this problem of happening when you only want the vertex data updated.
Do you mean that your application reads material properties (i.e. Ka, Kd, Ks, d, Ns, illum, etc) directly from mtl files? So far, when needed, I had to set those properties manually. In other words, diffuse, ambient, reflection, etc. properties of the vanilla materials weren't updted apparently. The one thing which was updated automatically, was the number of subset. What did I miss?
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-23-14, 07:53 PM   #3
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Do you mean that your application reads material properties (i.e. Ka, Kd, Ks, d, Ns, illum, etc) directly from mtl files? So far, when needed, I had to set those properties manually. In other words, diffuse, ambient, reflection, etc. properties of the vanilla materials weren't updted apparently. The one thing which was updated automatically, was the number of subset. What did I miss?
Try a version of the app > 400. I saw the same thing in versions < 400. In some version < 400 I screwed it up somehow and I don't know which version the screw up started. It should be working correctly now. Let me know if it's not.
TheDarkWraith is offline   Reply With Quote
Old 01-23-14, 07:56 PM   #4
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Try a version of the app > 400. I saw the same thing in versions < 400. In some version < 400 I screwed it up somehow and I don't know which version the screw up started. It should be working correctly now. Let me know if it's not.
Well, until yesterday we had v 1.1.374.1 or lower. I am now testing the latest version. I will inform you whether the feature finally works as supposed or not
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-23-14, 07:53 PM   #5
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Since that mesh only had 1 subset the app used the first newmtl definition it found as the material properties for the mesh when it updated the materials.
...and now that I think about it: why did GR2E used the default material, when the one subset had harbor_ital_cont2_subset0 assigned as its material
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-23-14, 07:56 PM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
...and now that I think about it: why did GR2E used the default material, when the one subset had harbor_ital_cont2_subset0 assigned as its material
That's the way I coded it. When reading the MTL file the newmtl definitions correspond 1:1 to the subsets. If you have more newmtl definitions then subsets then only the first number of subsets newmtl definitions will be used.
TheDarkWraith is offline   Reply With Quote
Old 01-23-14, 08:01 PM   #7
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
That's the way I coded it. When reading the MTL file the newmtl definitions correspond 1:1 to the subsets. If you have more newmtl definitions then subsets then only the first number of subsets newmtl definitions will be used.
Okay. In other words, I must always remove manually the 'default' material (from within Wings 3d it is not possible to do it). This would be a minor disturbance but (for the sake of programming cleanness)...

...how hard would be making your application to check actual subset/material linkings instead?
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-23-14, 08:36 PM   #8
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
In regards to that last suggestion click the Status tab in the app. I'm fairly certain that 99% of what's displayed in a dialog box shows up there also. You should also be able to highlight the text in the dialog box and press Ctrl+C to copy it to the clipboard.
Pressing Ctrl in the status tab unselects the text. Right click => Copy did the job though

Quote:
Originally Posted by TheDarkWraith View Post
Try a version of the app > 400. I saw the same thing in versions < 400. In some version < 400 I screwed it up somehow and I don't know which version the screw up started. It should be working correctly now. Let me know if it's not.
Well, just tested the feature with version v_1_1_404_1. Either material properties aren't updated (neither visual nor numeric setting changes), or I am doing something wrong.

Regarding subsets, have you ever seen this post of mine. I might have found and exception to the "max two (textured) materials per mesh"...
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 01-23-14, 08:50 PM   #9
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Okay. In other words, I must always remove manually the 'default' material (from within Wings 3d it is not possible to do it). This would be a minor disturbance but (for the sake of programming cleanness)...

...how hard would be making your application to check actual subset/material linkings instead?
Fairly complicated. Not something I'm interested in tackling currently. Maybe in the future.

The first thing I do when I work in Wings3D is delete the default material or rename it to the name I need.

Quote:
Originally Posted by gap View Post
Well, just tested the feature with version v_1_1_404_1. Either material properties aren't updated (neither visual nor numeric setting changes), or I am doing something wrong.

Regarding subsets, have you ever seen this post of mine. I might have found and exception to the "max two (textured) materials per mesh"...
I'll look into the material properties and why they aren't updating tomorrow

I'll check out the exception also tomorrow. I impose no limit as to the number of materials you can define for the mesh. Define away!

v1.1.405.1 released. See post #1
This version adds tooltips to the items in the import/export window and also adds a new checkbox to that window that deals with materials. When importing and the new checkbox is checked then the importer will read the MTL file and update all the mesh's materials. When exporting if the new checkbox is checked then the exporter will write a MTL file and everything else needed for the materials.



Movie time Work will continue tomorrow...
TheDarkWraith is offline   Reply With Quote
Old 01-23-14, 09:41 PM   #10
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Okay. In other words, I must always remove manually the 'default' material (from within Wings 3d it is not possible to do it). This would be a minor disturbance but (for the sake of programming cleanness)...

...how hard would be making your application to check actual subset/material linkings instead?
Actually more than 75% of the code for this is already there. I must've worked on this while overseas last year! When it's complete then that default material won't matter anymore. I might be able to finish it up tomorrow

I also see why the materials aren't updating (I see how I broke it!). Once again I'll fix tomorrow.

Now it's time to finally sit down on my own sectional and watch a movie on my own bigscreen
TheDarkWraith is offline   Reply With Quote
Old 01-24-14, 02:23 AM   #11
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

v1.1.408.1 released. See post #1

Fixed problem where materials that have been modified not showing (Modified) in the materials tab
Fixed problem of mesh's materials not being updated if the update materials checkbox is checked on an import
The import/export window will now hide after pressing the Import/Export button
Changed how the updating of mesh's materials works during an import with the update materials checkbox checked: importer will try and match up the objects defined and it's usemtl definition to the subsets (now that default material that's always defined in Wings3D MTL files is not an issue). If the importer matches up all that it can and there are some subsets that still don't have materials updated then it will default to using the remaining materials defined to fill in the subsets needing materials updated.
You no longer have to save/reload to see the material changes after an import. All the changes are done immediately and will be visible. This now forces you to plan your subsets/materials before an import. You need to ensure that the subsets have the correct (might need different materials assigned to them) materials assigned before import. Take for instance where a mesh has 2 subsets defined. You are wanting to import an OBJ file that defines 2 subsets with 2 different materials. If the current mesh has the same material defined for both subsets then both mesh's subset's materials will be updated with the last material properties.
If you are importing into a mesh and the import will cause the mesh to gain additional subsets then the importer can't update the materials for those additional subsets because no prior material was defined for them. You will need to assign a material(s) to those additional subsets after the import is complete.
If the importer can't find a texture specified in a material then it will ask you to find it for it (it will show a window where you can navigate to the texture to be used)
If your MTL file defines self-illumination/emissive (Ke) then you need to ensure the emissive/self-illumination is enabled in the material's extendeddata before doing the import. If the emissive/self-illumination is not enabled in the material's extendeddata prior to import then the importer will NOT update the material's emissive/self-illumination data.
There are only two maps the importer supports: map_Kd (diffuse) and map_Bump (or Bump). All other maps (map_Ks for instance) will be ignored. For the occlusion map (AO) define it as map_Kd and the importer will know how to handle it

TheDarkWraith is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 1995- 2026 Subsim®
"Subsim" is a registered trademark, all rights reserved.