STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
244
IN-GAME
1,645
ONLINE
Founded
8 November, 2013
All Discussions > Help > Topic Details
Taco 29 Apr, 2018 @ 6:12am
Question regarding custom normals and shape keys on DMX export
I'm testing a model that has heavily modified vertex normals on the face in order to achieve anime-style shading, the problem Im having is when the base normals are modified this much, any shape keys on the model end up with distorted normals that pretty much ruin the shading for the flexes.

I recorded a short video just to demonstrate: https://puu.sh/AcDld/1713314db3.mp4
(normals being calculated after triangulization)

I'm able to get around this by exporting a VTA file instead and compiling the old way, but I absolutely need to have corrector shapes for the kind of flex setup Im doing, which VTA has no support for.

This seems to just be how Blender handles vertex normals on shape keys, I'm wondering if there is any way at all around this issue, a way to possibly export the DMX file without the normals on the shape keys imploding?
Last edited by Taco; 29 Apr, 2018 @ 6:20am
< >
Showing 1-5 of 5 comments
Zappy 29 Apr, 2018 @ 6:24am 
If by "corrector" shapes, you mean something like using flex sliders A, B, and C applies shape keys A, B, C, A_B, A_C, B_C, and A_B_C, VTA fully supports that.
%a = a %b = a %c = a %a_b = a * b %a_c = a * c %b_c = b * c %a_b_c = a * b * c
The above code should yield the same flex result with VTA as having shape keys with the left names in a "simple" flex format DMX export.

But I would guess that the VTA export is actually what's wrong here, because if it looks broken in Blender, it's supposed to look broken in exports too, as exports are supposed to look the same as in Blender. Which means that Blender itself is probably the "wrong" thing here, not the DMX export. You may want to see if it's possible to supply manual custom normals per shape key in Blender. If it is, I'd imagine that that would allow the DMX export to look as you want it to, too, but I don't know if that's possible in Blender.
Taco 29 Apr, 2018 @ 6:46am 
Oh I completely forgot you could do that, but the corrector flexes then would still have to be triggered manually right? I suppose that is a solution, although far less elegant than having it automatically blend them in when the parent shapes become active.

Wether or not the VTA export is calculating normals as intended or not I am unsure of, they do store the direction of the normal in addition to the world position translation I think, so Blender's solutions for the flexed vertex normals before exporting is probably causing the problem.

Would it be possible to have an option to make the DMX export behave the same as the VTA, broken or not?
Zappy 29 Apr, 2018 @ 6:54am 
Originally posted by Taco:
Oh I completely forgot you could do that, but the corrector flexes then would still have to be triggered manually right? -
Again, if by "corrector flexes" you mean what's more commonly called "corrective flexes", you can use math to have them be applied automatically, as such:
$Model ModelName "ModelFileName.smd" { FlexFile "FlexFileName.vta" { Flex "A" Frame 1 Decay 0 Flex "B" Frame 2 Decay 0 Flex "C" Frame 3 Decay 0 Flex "A_B" Frame 4 Decay 0 Flex "A_C" Frame 5 Decay 0 Flex "B_C" Frame 6 Decay 0 Flex "A_B_C" Frame 7 Decay 0 } FlexController X "A" "B" "C" %A = A %B = B %C = C %A_B = A * B %A_C = A * C %B_C = B * C %A_B_C = A * B * C }
This loads shape keys A, B, C, A_B, A_C, B_C, and A_B_C from FlexFileName.vta, and creates flex controllers/sliders named A, B, and C.

When using flex slider A and B, shape keys A, B, and A_B are applied. (As you can see, the A_B shape key is set up to be applied with a scale of the A slider multiplied by the B slider.)
Last edited by Zappy; 29 Apr, 2018 @ 6:55am
Taco 29 Apr, 2018 @ 7:03am 
Ahh okay, these controller lines always confused the hell out of me but I see what you're saying now. Never even crossed my mind to set it up that way. I'll utilize that, thank you.
Taco 31 May, 2018 @ 5:44pm 
In case anyone else is wondering about this topic, I discovered the issue can be circumvented entirely by duplicating the mesh, and using data transfer to transfer the normals from the dupe specifically with the "Topology" setting. Simply export with the modifier enabled.
< >
Showing 1-5 of 5 comments
Per page: 1530 50

All Discussions > Help > Topic Details
Date Posted: 29 Apr, 2018 @ 6:12am
Posts: 5