Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Page 1 of 5 1 2 3 4 5
Joined: Oct 2013
eRe4s3r Offline OP
enthusiast
OP Offline
enthusiast
Joined: Oct 2013
Hi there, since I saw nobody yet post this I guess it's my duty to do so.

Norbyte (Who else?) created an absolutely fantastic utility

The Export Tool wink (It does in fact, convert GR2 to DAE and DAE to GR2.
This allows you to convert GR2 files.. to COLLADA DAE which you can load in Blender or 3DSMAX (both tested by Norbyte and me) and export from these apps back to DAE. Then you convert the modified DAE back to GR2, add it back in the game. And you have a modified GR2 mesh, complete with bones, skeleton, weighting and everything.

Download (This is Norbyte's Dropbox) File there is always up-to-date
https://dl.dropboxusercontent.com/u/32263228/dos/gr2/ExportTool.zip


For example, if you take a look at one of the body meshes in D:OS after unpacking the pak files. You can find for example here

Data\Public\Main\Assets\Characters\Players\PL_M_Body_A.GR2

Which is default male underwear mesh (as seen in 3dsmax 2013)
[Linked Image]

Turns out Roderick drank too much bear after winning....
[Linked Image]

A bit Export Tool vodoo, overwriting the relevant GR2 and...

Ingame magic
[Linked Image]

Since I am not a character modeler this is the extend of my abilities.. but someone who has the skills can with this likely edit the HAIR and BODY of ALL things in the game. You can also likely create new items and weapons, change existing ones. Or make better underwear... or naked meshes. Whatever. I am not judging you wink

The only thing I do not know is whether you can edit animations.

The bat files in the download allow you to quickly access all the tools functions. GR2 to DAE when you want to convert a D:OS mesh to DAE and load it in 3dsmax and Blender, and DAE to GR2 when you EXPORTED a DAE mesh from 3dsmax or Blender and want it in-game.

I don't need to tell you all what an incredible thing this is. Yes, you can now modify character meshes and mesh related things in the game world.

Caveats related to character mesh modifications. The skin texture is a greyscale (yes, really!) the skin color is applied by a shader. This means you are stuck in your colorization to what the skin shader in the game allows. It also means no "easy" conversion of Skyrim body meshes.... (Well.. which is not at all EASY since you have to rig the entire body again) this is something I honestly never want to do again...

So, cometh forth and mod this game. Now with 50% more modding possibilities. Thanks and I will repeat it, entirely to Norbyte. I tested, he made! Without him, we'd still be stuck at zero.

As bonus easter egg...

Rodericks body in Unity 5 riding one of my silly spaceship models rodeo
[Linked Image]

So things are possible now wink I hope someone else experiments with this further, as I am going to be very inactive very soon.

Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Fantastic work, congrats!


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Jan 2015
K
journeyman
Offline
journeyman
K
Joined: Jan 2015
boobs mods coming up. brave new world.

Joined: Oct 2013
eRe4s3r Offline OP
enthusiast
OP Offline
enthusiast
Joined: Oct 2013
From a modders perspective that'd be harder than you would think.

Every armor piece would need to be adapted to your mesh modifications or you'd either not see any change, or you'd have clipping. Also armors seem to overwrite or layer textures over the body mesh, no idea how specifically that works, but it's another factor to consider. So skimpy armor becomes specifically hard to actually do ;p (but same applies for MORE fluffed up armor)

And any other (higher detail) mesh replacement would require you to rig the entire thing all over again. And you better take note how Larian did the weighting on their meshes, because one slight mismatch and animations look wonky.

This is particularly relevant if a modder wants to, say, convert a skyrim body mesh to D:OS.....

Anyway, I hope someone with the skills needed will be able to use this for something. For mods this allows for entirely new art assets for literally anything.

Joined: Apr 2015
A
stranger
Offline
stranger
A
Joined: Apr 2015
Thanks for this!
I tried it with Blender 2.68. The convert to dae and import seem to work great, but when I try to convert collada-to-gr2 on the exported file I get an error. I have tried every combination of export options I can think of and all give the same error, or else produce a file which crashes Divinity OS. The error I get most of the time says:

"Conversion Failed!

System.InvalidOperationException: Sequence contains no elements
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
at LSLib.Granny.Model.Root.ImportSkin(skin skin)
at LSLib.Granny.Model.Root.ImportFromCollada(String inputPath)
at TestApp.Program.Convert(String inPath, String outPath, Boolean inGR2, Boolean outGR2)
at TestApp.Program.ExportUI(Boolean inGR2, Boolean outGR2)"

It sound like you got it to work with Blender. What version and export options did you use?

Joined: Oct 2013
eRe4s3r Offline OP
enthusiast
OP Offline
enthusiast
Joined: Oct 2013
Well.. I tested with 3dsmax, Norbyte with Blender wink

All I know is that you have disable Lights and Camera on export. Ie, they should not be part of the DAE. But aside and if disabling that doesn't fix the issue for you, only Norbyte can help you further.

Joined: Apr 2013
N
addict
Offline
addict
N
Joined: Apr 2013
Can you send me a sample .dae which fails to convert / crashes DOS?
Thanks!

Joined: Apr 2015
A
stranger
Offline
stranger
A
Joined: Apr 2015
I'd be happy to do that, though I'm not sure how. It should be pretty simple to reproduce -- I simply tried exactly what eRe4s3r shows in the example above: PL_M_Body_A.GR2 and PL_F_Body_A.GR2.

I've been using Blender 2.68, but I tried the latest (2.74) just to see if it made any difference (it didn't seem to).

Basically, I used lstools to extract Main; then I put the GR2 file in the export tool folder; then I opened a command prompt and ran "TestApp GR2ToCollada" which seems to work fine; then I opened Blender and imported collada (there is only one option for import - I mostly left it blank, but I tried both ways - it seems to change the direction the model faces); everything looks good at that point - I make changes to the mesh or not to test it, but either way seems not to affect the outcome.

Then I exported back to collada, and here's where I tried every combo of option I could thing of (I mostly tried selection only with the model and/or the armature selected, and either include children or armature as appropriate). Then I tried most other options in various combinations.

When I run "TestApp ColladaToGR2" I mostly get that error, but in some cases where I only had the mesh or the armature, but not both I think, the conversion made the new GR2. Then loading that in DOS cause a crash to desktop.

I notice the new files are bigger, so maybe that's an indication of a problem.

I strongly suspect that, since it worked for you, it has something to do with what I am doing in Blender like my export settings, but I've run out of guesses...

If you could say what setting you are using that might do the trick.

Thanks for helping!

Joined: Apr 2013
N
addict
Offline
addict
N
Joined: Apr 2013
Updated the exporter to fix a Blender skeleton import bug, should be working now.

Quote
I notice the new files are bigger, so maybe that's an indication of a problem.

That's because Blender doesn't deduplicate the UVs before exporting, so the same UV set appears multiple times with different indices and it increases the number of possible (Position, UV) combinations that should be exported to the GR2 file.
I'll add a separate position/UV filter step that should take care of this.

The higher vertex count may degrade performance somewhat but should not affect the mesh in any other way.

Quote
in some cases where I only had the mesh or the armature, but not both I think, the conversion made the new GR2. Then loading that in DOS cause a crash to desktop.

While a geometry without a skeleton, or a skeleton without a geometry is still valid GR2, it may not be valid for D:OS.
I've checked, and it seems that most D:OS meshes use a dummy skeleton with a single joint when no real skeleton is available.

Last edited by Norbyte; 07/04/15 05:27 PM.
Joined: Apr 2015
A
stranger
Offline
stranger
A
Joined: Apr 2015
Thanks Norbyte, the updated version worked great!

For future reference by others, here's how it worked: in Blender 2.68, when I impoted COLLADA produced by your tool, I checked the "Import Units" option, and when I exported COLLADA, I checked the "Selection Only" option with the armature and mesh selected and left all other options with their default values. Then I ran your tool to export to GR2, which produced a few warnings, but worked anyway. Then I made the folder ..\Divinity - Original Sin\Data\Public\Main\Assets\Characters\Players and dropped the GR2 files in there, and now they appear in-game.

Thanks again!

Joined: Apr 2015
A
stranger
Offline
stranger
A
Joined: Apr 2015
I've noticed one other thing: the skeletons -- Player_Male_Base and Player_Female_Base do not work in this process. They do not crash the converter or DOS, but when you get in the game, the character is very distorted with the head sideways and the legs off at funny angles.

Is there any chance of fixing that, or is it a settings issue of some sort?

Thanks!

Joined: Apr 2013
N
addict
Offline
addict
N
Joined: Apr 2013
I'm back.
Did you modify the skeletons in any way, or just a straight reexport from Blender?

Joined: Apr 2015
A
stranger
Offline
stranger
A
Joined: Apr 2015
I tried it both ways, same result.

Joined: Nov 2014
stranger
Offline
stranger
Joined: Nov 2014
Thanks for that great TOOL!

at first i want to give an huge applause to you and your fantastic guide for the material editor in the divinity engine.
After a while of testing, i wanted to modify an object and change some textures of it.
The export import of the MESH works correctly. Then I start to creat a new material with an new texture. I save the material as .lsmg (the only possibly file)

After that i start to import the new material, but i had to notice that the resource manager only let my import .lsb.

Have any one a idea, how i can get the .lsmg to an .lsb fiele? That i can import the material to the engine?

Greedings

Last edited by Sebbo Studios; 27/04/15 08:18 PM.
Joined: Apr 2013
N
addict
Offline
addict
N
Joined: Apr 2013
Here is the short version:

In the material editor window: File -> Regenerate Materials ...
[Linked Image]

Select Mods\%yourMod%\Assets\Materials
Click "Generate HLSL and GLSL"
[Linked Image]

After generation is complete, select Add Resource -> Material ... in the Resource Manager window.
Select the <materialName>.lsb file that was generated in the previous step, select a package from your mod. (You can leave the "Data mod" empty).
For some reason, the editor forgets the name of my material the first time I do this, so I end up with an unnamed material in the content browser. If you have the same issue, right click -> Rename/Move... and click OK. It'll fix the name issue.

If you have tex/scalar/etc parameters, you should also specify those in the next window.

Joined: May 2015
A
aqa Offline
stranger
Offline
stranger
A
Joined: May 2015
So I wanted to try my hand at changing a few armors, since I am really not a fan of the huge shoulderpads. I am certainly not an expert on 3d editing, but I am mostly able to struggle my way through it. But for me things are not going so easy as described in the OP.

The first armor I wanted to change is PL_F_ARM_Starter_A_Torso_A.
So as a test I converted it to a .dae file and back to a gr2, so far so good, that loaded up perfectly in the game. But when I try to make any change things stop working.

In 3dmax I am getting a bunch of errors while loading the file, and when without any edit exporting back to a .dae and converting to gr2 the armor is invisible in game.

When trying the same with blender it seems the skeleton is completely messed up, the armor pieces drag on the floor behind my character when she's walking about, like some weird snake made of armor pieces.

Is there some tutorial for dummies I could follow?

The errors I'm seeing in 3dmax:
While reading or writing a file the following notifications have been raised.
-Warning: The transform of node "Bone_Dummy_Root" is not compatible with FBX, so it is baked into TRS.
-Warning: The transform of node "Bone_Bip001" is not compatible with FBX, so it is baked into TRS.
-Warning: The transform of node "Bone_Bip001_Pelvis" is not compatible with FBX, so it is baked into TRS.
-Warning: The transform of node "Bone_Bip001_Spine" is not compatible with FBX, so it is baked into TRS.
-Warning: The transform of node "Bone_Bip001_Spine1" is not compatible with FBX, so it is baked into TRS.
-Warning: The transform of node "Bone_Bip001_Spine2" is not compatible with FBX, so it is baked into TRS.
-Warning: The transform of node "Bone_Bip001_Neck" is not compatible with FBX, so it is baked into TRS.
-Warning: The transform of node "Bone_Bip001_L_Clavicle" is not compatible with FBX, so it is baked into TRS.
-Warning: The transform of node "Bone_Bip001_L_UpperArm" is not compatible with FBX, so it is baked into TRS.
-Warning: The transform of node "Bone_Bip001_R_Clavicle" is not compatible with FBX, so it is baked into TRS.
-Warning: The transform of node "Bone_Bip001_L_Thigh" is not compatible with FBX, so it is baked into TRS.
-Warning: The transform of node "Bone_Bip001_R_Thigh" is not compatible with FBX, so it is baked into TRS.

Last edited by aqa; 05/05/15 08:38 PM.
Joined: Apr 2015
A
stranger
Offline
stranger
A
Joined: Apr 2015
@aga: See my post above: when you import COLLADA to Blender, you must check the "Import Units" option or you will see the result you describe.

@Norbyte: Just curious, do you think you will be able to fix the skeleton (Player_..._Base) import-export? Or is that pretty unlikely? Thanks!

Joined: May 2015
A
aqa Offline
stranger
Offline
stranger
A
Joined: May 2015
Originally Posted by Agamemnon1
See my post above: when you import COLLADA to Blender, you must check the "Import Units" option or you will see the result you describe.


Oops, I somehow completely missed your post.
It is not working for me unfortunately.

I am using these setting for importing:
[Linked Image]

And these for exporting:
[Linked Image]

Could you have a look and see if I'm missing anything?

Joined: Apr 2015
A
stranger
Offline
stranger
A
Joined: Apr 2015
Mine (Blender 2.68) has a few less options, but the only thing that's different is I don't have "Include Armatures" checked. I selected both the armature parent object and the mesh object which is a child of that before exporting (and nothing else).

Joined: May 2015
A
aqa Offline
stranger
Offline
stranger
A
Joined: May 2015
I tried your version of blender that did the trick, thank you so much. smile

It seems the newest version of blender imported it a little different, the model aligned to the Z axis blender 2.74, while in version 2.68 it is aligned to the y axis.

Page 1 of 5 1 2 3 4 5

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5