Wall Worm Forums

Design Tools => Wall Worm Model Tools => Bug Reports => Topic started by: StealthClobber on December 30, 2016, 01:11:31 PM

Title: DMX Export produces odd lighting characteristics
Post by: StealthClobber on December 30, 2016, 01:11:31 PM
I've been having this problem for quite a while now, but I've never bothered to post about it till now because I've just been using SMD instead in its place. For the record, I never used to have this problem with DMX, but somewhere along the line it changed.

I'm running the latest version of WW Pro on Max 2014. 2016 produces the same result, so it's not the older version that is the problem.

This is how the model should look (body exported with SMD):

(https://www.wallworm.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FnNuFuWG.jpg&hash=657e969f401501a9740d05a2787f067643177fb2)

And this is how the body looks when exported with DMX:

(https://www.wallworm.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FuMb64Q3.jpg&hash=3612fef93bb4c7633cf5758e32fb172a5b2cbbcb)

As you can see, the rim lighting completely bugs out on DMX, and the phong screws up too.

It gets even worse in SFM when you combine ambient occlusion in the mix:

(https://www.wallworm.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FNXfeX5v.png&hash=b5717e52ccf4dc27ef190c127363d1d03bc5c77d)
Title: Re: DMX Export produces odd lighting characteristics
Post by: Joris Ceoen on December 30, 2016, 01:15:48 PM
I won't be of much help for this particular issue, since I'm not experienced with SFM, nor with the DMX format. But I have a question out of pure curiosity: What is the difference between both file extensions, and why not just use .smd if that seems to work for you (I guess there's a good reason for it, which is why I would like to know).

In the mean time I'm sure Shawn will be able to help you when he has the time  :)
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on December 30, 2016, 01:18:30 PM
Thanks for reporting.

What is the Normal setting on the exporter? If you set it to Explicit Normals, do you get better results?
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on December 30, 2016, 01:29:27 PM
Also, if changing to Explicit Normals doesn't help, here are a few other things to try:


If the Explicit Normal fixes the issue, you can make this the default in the global settings (which I recommend for all WW Pro users).
Title: Re: DMX Export produces odd lighting characteristics
Post by: StealthClobber on December 30, 2016, 03:27:47 PM
Resetting the XForm solved the problem. Thanks Shawn!

As for the difference between SMD and DMX, DMX allows for wrinklemaps. However, from what I understand, the only way to make stereo flexes with DMX files is to open the DMX file itself and modify the flexes that way (as I've seen on tutorials for doing it Blender), but the DMX files that come out of 3ds Max are something like 6 million lines long.
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on December 30, 2016, 04:12:37 PM
Quote from: StealthClobber on December 30, 2016, 03:27:47 PM
Resetting the XForm solved the problem. Thanks Shawn!

Excellent!

Quote from: StealthClobber on December 30, 2016, 03:27:47 PM
As for the difference between SMD and DMX, DMX allows for wrinklemaps. However, from what I understand, the only way to make stereo flexes with DMX files is to open the DMX file itself and modify the flexes that way [...] but the DMX files that come out of 3ds Max are something like 6 million lines long.

There was an update to the DMX exporter several months ago (V.2.835 (http://dev.wallworm.com/topic/33/wwmt_changelog.html#update2.835)) that should have drastically reduced the file-size. Are you still experiencing such large file sizes?
Title: Re: DMX Export produces odd lighting characteristics
Post by: StealthClobber on December 30, 2016, 04:47:09 PM
Quote from: wallworm on December 30, 2016, 04:12:37 PM
There was an update to the DMX exporter several months ago (V.2.835 (http://dev.wallworm.com/topic/33/wwmt_changelog.html#update2.835)) that should have drastically reduced the file-size. Are you still experiencing such large file sizes?

The size for the head with flexes is 24 mb, but there is still over 1 million lines of code. It would just be drastically too inefficient to try to sort through all of it to enable stereo flexes, when I could just make separate stereo flexes in the morpher modifier. AFAIK, the process is much simpler with Blender's Source Tools, but I can't bring myself to learn Blender's weird interface.
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on December 30, 2016, 04:52:45 PM
How many tris is this model? I would be interested to see if the Blender DMX is significantly smaller than the WW export with similar meshes.

In terms of the stereo function, what exactly do you do to set it the manual way? Seems to me it would just be better to have a checkbox in WW for a morph target that sets it as stereo and then let the exporter just handle it. I've not messed with stereo but if you explain to me exactly how you set it up then I can probably just automate it.
Title: Re: DMX Export produces odd lighting characteristics
Post by: StealthClobber on December 30, 2016, 06:08:02 PM
Quote from: wallworm on December 30, 2016, 04:52:45 PM
How many tris is this model? I would be interested to see if the Blender DMX is significantly smaller than the WW export with similar meshes.

In terms of the stereo function, what exactly do you do to set it the manual way? Seems to me it would just be better to have a checkbox in WW for a morph target that sets it as stereo and then let the exporter just handle it. I've not messed with stereo but if you explain to me exactly how you set it up then I can probably just automate it.

Well the way it works with SMD/VTA is you have to set the flex you want as stereo manually in the qc file. It's similar for DMX, but you have to manually set it in the DMX file itself. Seeing as WW already creates the necessary flexcontrollers in the qc files for you when exporting to VTA, it seems like it would be possible to have said stereo checkbox, and have WW create stereo flexes in the qc by making the necessary adjustments (changing flex to flexpair etc.)

From what I understand in this guide by Pte Jack (http://steamcommunity.com/sharedfiles/filedetails/?id=245723825), for DMX it's as simple as setting the stereo boolean per flex from 0 > 1. However, when applying this to the DMX file outputted by WW, it separates the flex into stereo, but the stereo balance is set in such a way that the right slider controls the entire flex animation, with the left slider not doing anything. I'm not sure if it's possible to implement the stereo balance utility into WW as it is in Blender Source Tools,as shown here:

(https://www.wallworm.net/proxy.php?request=http%3A%2F%2Fimages.akamai.steamusercontent.com%2Fugc%2F272839745458581539%2F9BEA758E36DFD45F1C9576E7550230B4594A190D%2F&hash=4b445350478c5492a877ef15782639a1cae11979)
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on December 31, 2016, 01:01:07 AM
OK, I'll give it some thought in the new year for enhancing this. Feel free to share ideas.
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on January 01, 2017, 01:10:57 AM
Just an update on this. This isn't in the live download yet, but I have locally added support for both adding stereo and eyelid controllers and a way to control the stereo weighting. I'll test the update some more tomorrow and likely release that feature tomorrow afternoon/evening.
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on January 01, 2017, 01:57:42 PM
You can now use stereo and paint the balance in latest update. Basic overview is here: http://www.wallworm.net/index.php/topic,1988.msg6411.html
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on January 03, 2017, 02:32:33 PM
Did you test this new feature out?
Title: Re: DMX Export produces odd lighting characteristics
Post by: StealthClobber on January 04, 2017, 02:54:29 AM
I haven't checked back on here in a few days, so no. But wow that was quick work! I'll test it out as soon as I can.

EDIT: It works! Man I've been waiting a long time for a feature like this, I should've requested it sooner! :P You're awesome Shawn.

EDIT 2: Although I seem to be having a small problem. For flex target meshes that already have flex controller info, trying to add the new DMX controller info on top of them doesn't work, and I don't know how to remove the existing info. The "Remove Selected" button seems like it would do that, but it doesn't work.
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on January 04, 2017, 10:47:30 AM
I will add a function to update an existing or remove. Thanks for pointing that out.

In the meantime, to delete one already on a morph target, select it and paste this into the MAXScript listener (F11):

custAttributes.delete $ 1

And hit enter. It will remove the current one. Note that this presumes that there are no other custom attributes on the mesh... in which case it will delete the first one.

Then you can add the newer attributes to it.
Title: Re: DMX Export produces odd lighting characteristics
Post by: StealthClobber on January 04, 2017, 03:27:22 PM
Cool. That works for now.

I've got everything working fine, with the exception of eyelids. Following Pte Jack's guide, I've got eyelids moving with the eyeball flexes fine, but the eyelid flex (in this case called "CloseLid") defaults to half-closed at zero. I don't know if that's a WW issue or not, but I don't think so. Either way, a temporary fix for that is to just include separate eyelid open flexes, open them first so the eyelids will be at a normal state, and then the eyeballs when raised and lowered will still open the eyelids.
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on January 04, 2017, 03:51:44 PM
Good to hear.

In terms of the eyes defaulting to half... there is a Min/Max flex value for the controllers. I'm not 100% sure of their usage, but I've included them in the flex info and they will be in the flex controller. You might see if changing them from the default helps. I don't expect it to help but it's worth investigating.

When you do discover, please do share the easiest solution.

I hope you are enjoying this update! :)
Title: Re: DMX Export produces odd lighting characteristics
Post by: StealthClobber on January 16, 2017, 11:09:48 PM
Alright, so I'm back with some general observations about DMX flex exports.

Domination rules don't work. But I've identified one of the root causes. In the dominators section of a WW exported DMX file, the word "suppressed" is spelled as "supressed". Changing it to suppressed fixes the problem.

However there is another problem. Dominating flexes only seems to be able to dominate one flex at a time. Add a second flex, and the domination rule breaks and it won't dominate either flex.

I'm also still looking into the eyelid flex problem.
Title: Re: DMX Export produces odd lighting characteristics
Post by: StealthClobber on January 16, 2017, 11:26:49 PM
So after some looking around, I don't think the eyelid flex "problem" is a problem at all. I think that's just how they are supposed to look. I've seen some models exported with SMD and VTA that do some more complex calculations to have the same eyelid movement, and their eyelids start at a more opened state. However, thats VTA and it's very complicated to do so.

Seems most DMX models I see have the eyelids default to half closed when the eyelid bool is set to 1. Just as long as they work and the multi_CloseLid flex works as it's supposed to, I can live with that.  ;D
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on January 16, 2017, 11:29:44 PM
Thank you for reporting and investigating. I've fixed the suppressed spelling error in an update just loaded.

You never did tell me how you are getting along with the vertex painting of stereo flexes. Is it working as you'd expect?
Title: Re: DMX Export produces odd lighting characteristics
Post by: StealthClobber on January 16, 2017, 11:30:55 PM
The stereo painting works 100% as it should. Just wish I knew how to turn the black/white coloring and flat shading off and keep the balance modifier in the stack.  :P
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on January 16, 2017, 11:35:57 PM
Once you are done coloring, you can right click the object and go to Object Properties and turn off vertex color display. You can also disable vertex color display in the vertex paint modifier's paint floater (icons at top).
Title: Re: DMX Export produces odd lighting characteristics
Post by: StealthClobber on January 16, 2017, 11:37:38 PM
Ah, such a simple solution. I've never used the Vertex Paint modifier before this so I still have much to learn.

I await the dominator fix with much anticipation.  :)
Title: Re: DMX Export produces odd lighting characteristics
Post by: wallworm on January 16, 2017, 11:40:16 PM
I actually loaded it already a few minutes ago (spelling error). As for not working with multiple dominated flexes, that will need more poking. I don't have any documentation on it at the moment.
Title: Re: DMX Export produces odd lighting characteristics
Post by: StealthClobber on January 16, 2017, 11:41:27 PM
Oh that's what you meant by "loaded it". Ok cool. Well I await the multiple flex dominator fix with much anticipation then.  :P