Python model converters
Moderators: winston, another_commander
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Python model converters
Quick question concerning the Python model converters: I want to modify a .dat model which uses several textures, but I can't convert it into an .obj file while keeping the same textures applied to the model. Do I need to import it without any textures and then manually re-UV-map it?
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Re: Python model converters
Or rephrasing it: what is the best workflow to alter someone else's .dat model using Wings3D, which may use more than one single texture?
- Stormrider
- Deadly
- Posts: 241
- Joined: Sat Jan 25, 2014 2:35 am
- Location: At work
Re: Python model converters
The UV layout is preserved so you should be able to apply the same textures once you convert the model back to a .dat, but any modified faces of the model that don't match up with the original UV layout may not be textured properly.
I converted a model, loaded it into wings, made a modification, then exported it. I had to edit the .dat to get it to use the old texture, down near the bottom of the file I changed:
to the original texture:
Defiantly got some distortion but I really enlarged a few surfaces next to the dock:
Unless you are going to make any drastic changes to existing faces or add new ones it seems to work.
I converted a model, loaded it into wings, made a modification, then exported it. I had to edit the .dat to get it to use the old texture, down near the bottom of the file I changed:
Code: Select all
NAMES 1
0
Code: Select all
NAMES 1
witchfire-saloon-33.png
Unless you are going to make any drastic changes to existing faces or add new ones it seems to work.
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Re: Python model converters
Hi Stormrider, thanks for the reply!
Yes, that is exactly my problem: unfortunately my case is complicated because I am adding new faces to the model, but also because this model uses more than one texture. I so much wished there was a trivial way of editing this, having to use these conversion tools and running into all these problems is so off putting for someone just starting out with 3D modellingStormrider wrote:The UV layout is preserved so you should be able to apply the same textures once you convert the model back to a .dat, but any modified faces of the model that don't match up with the original UV layout may not be textured properly.
Re: Python model converters
imagine a thin person -> mr bean
you are adding/inserting large protruding objects into mr bean, how does mr beans skin behave?
you are lucking if you can use the existing uv map ( with small changes ), i think you have to make a new uv map when making many big changes,
you can make the new additions into a new model itself, make a new uvmap/texture for the new model and 'add' as a subentity
think of it as skin, if you move your nosebone to your chin does the noseskin automatically move with it?
you are adding/inserting large protruding objects into mr bean, how does mr beans skin behave?
you are lucking if you can use the existing uv map ( with small changes ), i think you have to make a new uv map when making many big changes,
you can make the new additions into a new model itself, make a new uvmap/texture for the new model and 'add' as a subentity
think of it as skin, if you move your nosebone to your chin does the noseskin automatically move with it?
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Re: Python model converters
@cbr I understand that, but what I actually called frustrating is how cumbersome is the process of converting dat <-> obj and how those Python converters do not handle objects with more than one texture, not the fact that adding faces result require a new UV-map. The issue is that, if I understand correctly, there is a limitation with those Python conversion programs that make you have to either import dat models that use one single texture or import a dat model ignoring textures. And then there is the cumbersome workflow for editing an existing model: dat -> obj, import obj and save as wing, export it back as obj, convert back to dat, perhaps edit it manually as to add the textures back to the file.
Re: Python model converters
Perhaps you could rephrase your frustations with the different tools into one simple question, somebody could know a solution, a tool or a script which could help you.
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Re: Python model converters
My apologies. My question is: what is a reasonable workflow to edit an DAT model using Wings3D when the DAT model in question uses more than one texture and therefore can only be converted into OBJ by ignoring all textures? Is there an easy way of doing that?
- Stormrider
- Deadly
- Posts: 241
- Joined: Sat Jan 25, 2014 2:35 am
- Location: At work
Re: Python model converters
I think you will have to create a new UV map then. I am not sure if there is a way to add new faces to an existing UV layout in wings without creating a new UV map. If the new faces aren't on the UV map they won't get textured at all.gsagostinho wrote:Yes, that is exactly my problem: unfortunately my case is complicated because I am adding new faces to the model,
I believe this is more of a limitation of the OBJ file, I have read that they only support one material so the python converter will only apply that to the model in the conversion process.gsagostinho wrote:obj and how those Python converters do not handle objects with more than one texture,
Your frustration is understandable but its not really the converters, I have the same issues with OBJ files exported from one model utility and imported into another, eg makehuman ->blender (no conversion software involved).gsagostinho wrote:I understand that, but what I actually called frustrating is how cumbersome is the process of converting dat <-> obj and how those Python converters do not handle objects with more than one texture, not the fact that adding faces result require a new UV-map. The issue is that, if I understand correctly, there is a limitation with those Python conversion programs that make you have to either import dat models that use one single texture or import a dat model ignoring textures. And then there is the cumbersome workflow for editing an existing model: dat -> obj, import obj and save as wing, export it back as obj, convert back to dat, perhaps edit it manually as to add the textures back to the file.
Please don't give up, the texture packs you created look awesome.
-
- ---- E L I T E ----
- Posts: 675
- Joined: Sat Aug 09, 2014 4:16 pm
Re: Python model converters
If you can point me to such a model you want to deal with, I can show you what Blender can do with the converted DAT file. I had some tweaks made on the python conversion scripts, and they might fit your needs.gsagostinho wrote: ↑Sun Jul 30, 2017 9:35 pmMy apologies. My question is: what is a reasonable workflow to edit an DAT model using Wings3D when the DAT model in question uses more than one texture and therefore can only be converted into OBJ by ignoring all textures? Is there an easy way of doing that?
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Re: Python model converters
@Stormrider Thanks for the answer and for the info, Stormrider, I really appreciate it. I will continue taking a look at this, let's see how it goes
@Commander_X Many, many thanks. Well, I am trying to increase the poly count of the asteroid part of the new Imperial Astrofactory. You can download the latest version using the in-game extension manager.
@Commander_X Many, many thanks. Well, I am trying to increase the poly count of the asteroid part of the new Imperial Astrofactory. You can download the latest version using the in-game extension manager.
-
- ---- E L I T E ----
- Posts: 675
- Joined: Sat Aug 09, 2014 4:16 pm
Re: Python model converters
Well here are some quick results of how the station looks in Blender:
matcap
textured
I didn't put too much effort into materials for the textured version, I mainly split the UV from how Blender imports it.
Here is the version of the script I used for conversion. You'll definitely want to manually create the materials, and match the textures.
matcap
textured
I didn't put too much effort into materials for the textured version, I mainly split the UV from how Blender imports it.
Here is the version of the script I used for conversion. You'll definitely want to manually create the materials, and match the textures.
-
- ---- E L I T E ----
- Posts: 675
- Joined: Sat Aug 09, 2014 4:16 pm
Re: Python model converters
Ok, I looked back at the posts in this thread, and it seems that not the conversion was the culprit, but the modelling afterwards.
Unfortunately, the conversion back from the models in-game will result in triangulated meshes. That is a no-no for modelling/changing the model.
You will have to take your time and merge the triangles to quads following the layout of the UVs in order to be able to properly make changes to the model, otherwise you won't be able to reuse the original textures.
Unfortunately, the conversion back from the models in-game will result in triangulated meshes. That is a no-no for modelling/changing the model.
You will have to take your time and merge the triangles to quads following the layout of the UVs in order to be able to properly make changes to the model, otherwise you won't be able to reuse the original textures.
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Re: Python model converters
I do not understand what you mean, Commander_X. I am aware of what are triangle and quad meshes, but I don't understand what is a "no-no" regarding them. Wings3D can use either type of mesh, and I have successfully exported both types of mesh to Oolite. Could you explain this better to me?Unfortunately, the conversion back from the models in-game will result in triangulated meshes. That is a no-no for modelling/changing the model.
Also, many many thanks for taking a look at this.
-
- ---- E L I T E ----
- Posts: 675
- Joined: Sat Aug 09, 2014 4:16 pm
Re: Python model converters
Here's a final quote from an answer to a similar question:
Quads at the assets creation level, and triangles at the engine level!