March 29, 2024, 16:52
bigger smaller reset     1020px Wide width Full width Reset   * *

Gildor's Forums

  Homepage Facebook Read news on Twitter Youtube channel Github page
Welcome, Guest. Please login or register.
Did you miss your activation email?

« previous next »
Print
Author Topic: Vertex normals and ActorX  (Read 3684 times)
floxay
Full Member
***
Posts: 83



View Profile
« on: September 26, 2021, 02:22 »

Hey Gildor!

Would you consider adding a chunk to store vertex normals in with the ActorX format?

I realize that it's not supposed to hold that data but since the .pskx extension is already a thing and smoothing groups are not exactly working it might be a "better solution".
On many models, especially in multiplayer/shooters (e.g. Fortnite, Valorant) the lack of this data is pretty noticeable due to models being lower poly than usual – but still rather complex, combining organic and hard surface elements – due to better performance.

I added it like this and it seems to have no issues (at least on Windows) ac84c62/Exporters/ExportPsk.cpp#L250-L264
Obviously the import addons should be updated as well. Luckily none of those seem to have trouble with unknown chunks (and for Blender an updated script already exists)
If you decide to add something like this it would be appreciated if you could call the chunk "VTXNORMS" as well.
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #1 on: September 26, 2021, 09:34 »

Hi,

If someone will update 3ds Max importer script, then I'll consider this. The Max importer is a primary one, but I'm not supporting it myself anymore.
Logged
floxay
Full Member
***
Posts: 83



View Profile
« Reply #2 on: September 28, 2021, 20:26 »

Added VTXNORMS chunk reading and loading of vertex normals. (script attached)

According to the MAXScript help site:
Quote
Since 3ds Max 2015, setting a vertex normal sets the normal as Explicit, so it will retain its value when the mesh gets updated. In versions prior to 3ds Max 2015, setting the vertex normal using MAXScript had only a very short lasting effect because the data would be easily overwritten by the Smoothing Group-based implicit normal recalculation on viewport redraw or scene rendering.
I believe it should be fine on those versions too as I'm setting them as explicit in line 1340 but I have not tested it as I don't own or able to download a Max version below 2019 legally.
edit: tested on max 2010, appears to be fine

Huge thanks to Allen from the Xentax discord who noticed what I was missing and fixed it, without their help I would have just given up on this.

Some pics from 3ds max 2022:
https://i.ibb.co/h97qYPP/image.png
https://i.ibb.co/84mMHsd/image.png

Edit: some meshes appear to not import correctly, no clue why, there is a dropbox link below with samples if anyone feels motivated enough to touch maxscript

* ActorXImporter.ms (63.95 KB - downloaded 95 times.)
« Last Edit: October 03, 2021, 20:23 by floxay » Logged
RedBear
Full Member
***
Posts: 226


View Profile
« Reply #3 on: October 03, 2021, 13:41 »

Excellent work, floxay!!!
I've been waiting for a similar functionality in Umodel for a long time!
The updated ActorXImporter.ms script is attached, but where can I download the updated Umodel with support for PSK export with vertex normals? I would like to try it on my 3ds max 2011.
Logged
floxay
Full Member
***
Posts: 83



View Profile
« Reply #4 on: October 03, 2021, 18:18 »

where can I download the updated Umodel with support for PSK export with vertex normals?

In the original post there is a github link, if you go back to the root of it you can find umodel.exe, here is the direct link: https://github.com/floxay/UEViewer/raw/master/umodel.exe

Please note that this build has some other changes in it as well, if you would like a 'vanilla' umodel with only the VTXNORMS stuff check out the 'normals' branch [link], tho you will need to build it yourself as I have not uploaded an executable.
« Last Edit: October 03, 2021, 18:20 by floxay » Logged
RedBear
Full Member
***
Posts: 226


View Profile
« Reply #5 on: October 03, 2021, 19:02 »

In the original post there is a github link, if you go back to the root of it you can find umodel.exe, here is the direct link: https://github.com/floxay/UEViewer/raw/master/umodel.exe
It looks like something went wrong. Either the updated script does not work correctly with 3ds max 2011, or the updated Umodel does not export normals correctly.

UPD: Same result in 3ds max 2020.  Undecided


* Безымянный.png (271.42 KB, 1920x1032 - viewed 385 times.)
« Last Edit: October 03, 2021, 19:06 by RedBear » Logged
floxay
Full Member
***
Posts: 83



View Profile
« Reply #6 on: October 03, 2021, 19:26 »

could you please send me the psk?
Logged
RedBear
Full Member
***
Posts: 226


View Profile
« Reply #7 on: October 03, 2021, 19:46 »

could you please send me the psk?
https://www.dropbox.com/sh/kxf2xd5zg5fav4s/AADuxpvs-QGpL4eYzjtLt71va?dl=0
Logged
floxay
Full Member
***
Posts: 83



View Profile
« Reply #8 on: October 03, 2021, 20:21 »

Well, unfortunately I have no clue, I'll just give up on this MAXScript stuff I think, Blender plugin works fine with both meshes and is much faster..
Logged
RedBear
Full Member
***
Posts: 226


View Profile
« Reply #9 on: October 04, 2021, 10:54 »

Well, unfortunately I have no clue, I'll just give up on this MAXScript stuff I think, Blender plugin works fine with both meshes and is much faster..
So, do these PSK work in Blender without issue?
Logged
floxay
Full Member
***
Posts: 83



View Profile
« Reply #10 on: January 25, 2022, 14:15 »

So, do these PSK work in Blender without issue?

If you update the importer addon then yes, otherwise it will just skip the normal data.
Logged
Print 
« previous next »
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS