The script that JC_SV compiled was fine, but there's one thing that I changed for my own usage.
When the autosmoothing is off in Blender the exporter will not add "crease xx" line.
The Majics script will add "crease 30".
BOTH are wrong... Why?
Because when exported to FG the model doesn't look like the shaded model you had in Blender.
The game engine adds creasing if it isn't in the .ac file (45 degrees or so).
I control the sharp edges with "split edges" not with autosmoothing.
The solution I made is to rewrite function "extrait_crease" in the exporter, like this:
- Code: Select all
def extrait_crease( obj, mesh ):
pi = 3.141592653589793238462643383279502884197
if len(obj.modifiers)!=0:
for mod in obj.modifiers:
if mod.type=='EDGE_SPLIT':
return mod.split_angle/pi*180.0
if mesh.use_auto_smooth:
if mesh.auto_smooth_angle!=0.0:
return mesh.auto_smooth_angle/pi*180.0
else:
#return -1.0
return 179.0
return 30.0
You can notice I commented out "return -1.0" where the exporter would ignore creasing because autosmoothing was not set. I replaced it with "return 179.0". Solution with best results for FG.