The old code was objectively terrible and placed the burden of handling
missing values effectively on the user instead of just figuring it out.
This is objectively better in that we can now count on all values being
"known" at keyframe convert time. Whether that "known" is because it's a
real keyframe, we evaluated it, or we pulled it out of our @$$ is
another story, of course.
A few observed problems:
- In PotS, any physical parented to another object fell through the
floor on link in.
- In MOUL, physicals in a subworld were exported in the wrong coordinate
system. They were exported in local-to-world space, but MOUL expects
them in local-to-subworld space.
- In PotS, any scaled physical parented to another object wiped out the
visual (but not physical) scaling due to an improper flag setting.
Font objects were exported as a completely different SceneObject,
causing the parenting relationship to be broken. This ensures that the
drawable is properly attached to the correct SceneObject.
This was troublesome in that the Blender documentation implies that
`FCurve.range()` returns times when it actually returns frame numbers.
This superceeds and closes#216. Prefer this fix because
`functools.reduce` is not as readable and the formatting is closer to
what exists in the animation converter.
For some reason, SetDefExp2 type fog doesn't seem to work upon export, but regular SetDefExp does. This is just a proposed minor change to use the regular SetDefExp option if fixing the other is too big a task.
This fixes the layer preshade color to be black when runtime lighting is
requested. Further, both preshade and runtime are properly set to black
for emissive layers.
This appropriately marks spans as VtxNonPreshaded if they use vertex
alpha or runtime lighting. In those cases, we properly fold the runtime
light color into the vertex color as expected by Plasma.
This matches us up more closely with what PlasmaMAX does and allows us
to really fix x-raying effects by properly forcing objects into the
correct render pass.
Blender can crash during export when baking vertex colors to shared mesh
data objects. Doing that can lead to lighting gotchas, but it's better
to have lighting gotchas than crashes.
This enables the Blender Mesh Normal panel and exports any double sided
mesh with double sided layers to Plasma. The implication is that the
mesh will be rendered twice in game--the second time with the winding
reversed. Wavesets marked double sided are ignored due to the runtime
generation of layers in game. Trying to make a double sided waveset is
therefore nonsense.
Translation of the rules posted by Sirius @ https://forum.guildofwriters.org/viewtopic.php?p=73757#p73757
PotS is in worldspace when the mass is non-zero. Plasma likely detects
nonzero mass as "this object can move" and expects localspace. MOUL on
the other hand uses localspace if the object has a CI, otherwise
worldspace.
MOUL/DX9 will not rt light any vertex with a near-zero component in its
normal. This prevents shadows and decals from appearing on flat surfaces
in Ages exported for the MOUL engine. Instead of fighting with the
pipeline and vertex buffer code in Plasma, we'll just clamp the values
here.
This allows for objects to print decals at runtime, like the baskets in
Eder Gira. Also, the same functionality can be hijacked for coincident
objects to exist as decals. This is basically a shortcut for adding hack
Z-flags to the base layer of a decal material.
This allows blend textures to be used for mesh transparency without
having to fiddle around too much. It was also a stab at fixing some
regressions in the MOUL engine around decals, but that bit failed,
sadly.