Topic: Normals smoothing in Maya > To 3DS MAX > To Source Engine (Restored)

Started by wallworm, October 12, 2011, 07:03:12 PM

Previous topic - Next topic

wallworm

Retrieved posts from Google Cache.
Kevinglongtime Wrote:

Hey all,

I've been having this issue that has been bugging me where my models arn't keeping the types of normals-smoothing i've been giving them in Maya (as you can tell this question I dont think pertains to wallworm itself).

I use Maya for all my work and I use 3DS max purely for this export tool. Long story short, when I import the final product from maya > to 3ds max > to source, the results turn out being that everything on the model is now smooth regardless of what I had manually did myself in maya. So that means all the hard edges on a cube, for example, would look very odd and smooth.

I never had this issue when doing it the regular way of compiling so I think this issue boils down to the bringing over of models and maya's own way of smooth over to 3DS max (If I read right, 3DS max has an entirely different way of smoothing and its called "smoothing groups").

Anyone have the knowledge to shed light on the best way of going about this so that it retains my set normals smoothing while transfering? The odd thing is, in the viewport of 3DS max, the smoothing seems fine but when it gets to source it looks all messed up. I am self taunt in using these program so I may be missing what some of you may consider an obvious option or file type for exporting or even an importing option for 3DS max. I've been mainly using the .obj format with the normals option ticked to bring over the normals smoothing.

This is how odd the flat surface on my stopsign is looking in Source model viewer becuase of all these edges getting oddly smoothed

wallworm

Skipping Ahead in old Conversation:
Very interesting.

WWMT itself never even considers smoothing groups. It is the SMD exporter that handles all that. In WWMT, the only time Smoothing Groups are touched are when you press the Process Hull or Prepare Hull buttons... and those are really only to help add smoothing groups to collision hulls if it is $concave. In terms of WWMT, the only thing I could think of is if you assign a model than pick that same model with the Hull picker... and use the process hull function. In that case, WWMT would assign each Element of the object a unique smoothing group... but even in that fringe case, I can't imagine your model would be such that each face is its own Element sub-object.

(BTW, it's generally not recommended to select your model as the collision hull... just for anyone new reading this thread. You should make a separate model as much as possible.)

It may be something else... perhaps too many smoothing groups? (I don't know if Source has a limit..)

Anyway, I'll forward this thread to the SMD export developers (Wunderboy and Canonfodder) and see if they have any input. Which one are you using?

wallworm

Kevinlongtime wrote:
Ohh alright, I see what you mean, and it looks like I was using v1.5 but I have now upgraded to v1.6 and the same thing occurs.

Thanks for fowaring it on to them! Much apprecited

Also, I'm not sure if this helps but I used to use a program called milkshape (when I compiled manually) to get the smd and then use GUIstudio to compile and get the model to source and this was via the old way of how I used to do it by exporting an obj from maya (which would lock the normals, same thing) and import into milkshape and those models never had an issue with smoothing in the end. I dont know/remember what sort of smd exporter milkshaped used though.

wallworm

I have found the problem.

Even though the model looks smooth in the viewport, it doesn't actually have any smoothing groups at all. NONE. I assume that it isn't actually translating in from Maya to Max via FBX... but as I know nothing of Maya it's hard to predict.

You can tell this by selecting face sub-object mode and selecting faces... and in the command panel scrolling down to the smoothing group section... there are no SGs assigned to ANY faces. They look smooth either because of their actual orientation and/or a viewport setting.

Not to worry. I have a fairly quick solution for you.

Go into Element Sub Object mode and select each Element one at a time. When selected, scroll down to the Smoothing group section and choose Auto Smooth.

It may not produce 100% of what you want but from what I did with you model (which has 2 Elements -- the body and the base), it worked flawlessly. If something isn't just right, then you can go into face sub-element and specifically assign SGs.

Attached is a screen shot as reference. (Far left is inside HL Model Viewer after this process and exported).

wallworm

Wunderboy Wrote:
I don't have an answer for sure but I've seen this behaviour before. The same sort of thing happens in 3DS Max when importing an SMD with my import plug-in and then re-exporting it.

See there are two ways of setting smoothing in Max - explicit normals where you set each vertex normal individually or Smoothing groups where the normals are calculated for you based on the smoothing groups of the neighbouring faces on the current faces edges.

Most people use the smoothing groups option and set the group automatically or explicitly for each face as it's just easier and goes better with the continuous mesh ideal. However might importer uses explicit normals as that's how they are defined in the SMD and as of yet, I haven't found a quick way to rebuild the smoothing groups from them.

However, with explicit normals it's often easy to destroy the smoothing by making changes to the base geometry. In fact in various versions of Max I've found that even adding some modifiers to the stack can destroy the smoothing which is a complete PITA.

My own experience with OBJ files is that they too produce junk half the time and the results are largely down to the quality of the export and importer code that handles them. 99% of the time any OBJ I've tried to bring into Max ends up with one smoothing group (to rule them all).

FBX I've had better luck with but at the end of the day - it depends on how they handle normals. I think FBX uses smoothing groups like Max but if you're using explicit normals that could be where the problems lie.

The SMD exporter does actually have a "Use alternate normals method" option which uses different code for exporting the smoothing. By default it looks for the auto-generated normals from the smoothing groups but if you've got explicit normals, these don't export and you get a faceted looking model. That's when you should try the alternate normals method. That looks for explicit normals and exports those instead.

It looks to me a lot like you're suffering from the visual normals being OK between Maya -> Max but the underlying normals definition is not being picked up by the SMD exporter code. Try the alternate method and see if it make a difference.

wallworm

Kevinlongtime wrote:

Thank you so much, both Wunderboy for taking the time to explain and re-write the normals export code and as always Shawn for helping out!

I haven't been able to test it as of right this moment becuase I have Max 2011 32bit (shouldn't work, right?) but from what Shawn has mentioned about the FBX file I sent him working on export now sounds very, very promising! I'd love to give it a test !

As for trying out the option for alternate normals, I don't recall the window popping up during normal compile with model tools for options such as clicking alternate normals so idk how i'd do that:S. Though, I'm guessing I should just wait anyways for the test built since you have already re-written the code for the next release?




YES!!!! I have just recieved the test version of the plugin with the new export normals code courtesy of Wunderboy (and Shawn for relaying messages) and it works beautifully. Seems to work perfectly even when importing OBJs now! Thank you once again Shawn for sticking through trying to help and contacting Wunderboy and Wunderboy again for re-doing the code which seemed to do the trick:)!

Well, that hurdle seems to finally be gone. Feels like some creative freedom now

Here is how the model from TF2 that I was testing is looking like in the source engine now after compile (like it should, smoothing wise)

SMF spam blocked by CleanTalk