4
4
mirror of https://github.com/H-uru/korman.git synced 2025-07-14 02:27:36 -04:00
Commit Graph

381 Commits

Author SHA1 Message Date
be7e9427c4 Blender 2.77 on Win32 fails with ctypes
So we bump the version requirement to Blender 2.78
2017-06-12 15:51:52 -04:00
80ce28ddc8 Show the console during exports
The only major issue with the console based progress solution is that
the user would have to remember to press "Toggle System Console" before
the export. This button corresponds to the operator
`bpy.ops.wm.console_toggle`. Unfortunately, Blender does not expose a
way for us to query the console state. So, we have to get nasty and use
ctypes to ask the OS if the console window is active. The user may
already have it open and hidden behind Blender's UI, after all.

This changeset causes the console to open during the export (unless
disabled in the export operator). If the console was closed before the
export, it closes again once the export is finished, unless there is an
error. If the console was open, it remains open.

Unfortunately, this only works on Windows. But, according to the source
code of `bpy.ops.wm.console_toggle`, Blender's `ghost_toggleConsole`
only functions on the Win32 subsystem... SDL, X11, and Cocoa are all
no-ops. Future work would include a patch submitted to Blender adding an
enum property to the console operator to avoid this code duplication.
2017-06-12 15:36:03 -04:00
5c8a9253fe Sirius said he liked watching the PyPRP log...
... So now he can watch the Korman log in real time
2017-06-12 15:36:03 -04:00
d465b86f9c Handle errors better in the progress manager
Now the progress display will recognize errors using the `__exit__`
magic method and print out an error header with the actual error
message. This is useful because when the mouse leaves the Blender
operator's report error, the error "window" is destroyed. This led to
potential silent failures.
2017-06-12 15:36:03 -04:00
4842731a44 Better long-running progress report behavior
For sanity, I stripped the progress manager into a subclass. From there,
I moved all of the progress printing into a thread so that we can accept
signals for step progress. If there is no step progress for a time, we
show the user a rolling set of ellipses to prove we're not dead (yet).
2017-06-12 15:36:03 -04:00
98d5480024 Implement rudimentary progress reporter
A common complaint that I have heard (and have nyself) is that there is
little indication of what Korman is doing in the background. In PyPRP,
the raw export log was dumped to the console, and many liked to watch it
travel by as an indicator of progress. As such, I have implemented a
rudimentary progress monitor that outputs to the console into the export
logger.

Unfortunately, there is no "easy" way to show progress in the Blender UI
currently. Korman makes the assumption that nothing will touch
Blender's context while it is executing. Attempts to mvoe the exporter
into a background thread have all resulted in spectacular failures. So,
this will have to do for now.
2017-06-12 15:36:03 -04:00
6a3b09b747 Refactor export logging
The export logger and export reporter have been merged together to form
an eventually much more powerful export analysis feature. For now, the
benefit is that general log messages don't have to be so fiddly with
print statements and string formatting. You're welcome.
2017-06-12 15:36:03 -04:00
f5b5e329ae Merge pull request #50 from dpogue/bumpmaps
WIP: Normal Maps/Bumpmapping
2017-06-11 23:49:43 -04:00
a998c676f5 Merge pull request #1 from Hoikas/bumpmaps
Bumpmap Cleanups
2017-06-11 20:45:11 -07:00
08d93dd797 Update GeoVertex UV touching for HSPlasma changes
plGeometrySpan.TempVertex.uvs now returns an immutable tuple, so we have
to convert that to a list. Furthermore, I took the liberty of changing
to code to avoid spin-washing on the first encounter of a bumpmapped
vertex.
2017-06-09 16:09:37 -04:00
64369b836d Update some bumpmap variables to obey The Zen 2017-06-09 16:09:37 -04:00
c52335fb47 Don't preempt UVChannel sanity checks in bumpmaps
This makes UV channel calculations and errors a little bit more sane.
2017-06-09 15:53:48 -04:00
1a58ef2ea2 Fix Lamp Animation error introduced by #54
The changeset referenced makes the assumption that
`grouped_fcurves[chan]` is a dict. We really can't assume anything about
types this deep inside the animation converter.
2017-06-06 23:33:19 -04:00
959cde78b7 Fix #55 2017-06-06 23:00:50 -04:00
8c525dca02 Update C korlib to link with string_theory 2017-06-06 22:33:08 -04:00
fc4229d4c4 Force layers after a bumpmap to their own pass 2017-02-18 22:17:05 -08:00
b1dc8a7dfe Fix for compiling with Python 3.6
Ported from libHSPlasma
2017-02-18 22:17:05 -08:00
887700f472 Move create_bump_LUT to top level korlib 2017-02-18 22:17:04 -08:00
3753714cd6 Cleanup the C++ code 2017-02-18 22:17:04 -08:00
2a693a03c2 More cleanups 2017-02-18 22:17:04 -08:00
00536bb7cb Clean up the easy bits of mesh exporting 2017-02-18 22:17:04 -08:00
4cf1933398 Avoid normalmap export code duplication 2017-02-18 22:17:04 -08:00
a8c84d0a45 Add pure-Python create_bump_LUT function 2017-02-18 22:17:04 -08:00
ce5ef0d35c Generate _korlib with the right name 2017-02-18 22:17:04 -08:00
082eb0e6ca Generate the BumpLutTexture 2017-02-18 22:17:04 -08:00
11716fce3b Match PlasmaMax's BumpMtl options
The "strength" of the normal mapping is the red channel of its runtime
colour.

If the normal map is a specular map, it should be Add blending,
otherwise it should use MADD blending.
2017-02-18 22:17:03 -08:00
25d92fc7f4 Initial implementation of bumpmapping
A few unfinished bits:

1.  This doesn't properly handle multi-material objects, which are
    permitted to have separate bumpmaps on each material.

2.  This doesn't generate the BumpLutRamp image for the Du, Dv, Dw
    layers.
2017-02-18 22:16:59 -08:00
9d3254111a Merge pull request #54 from MareinK/animation-missing-axes
fix animation exporter not being able to handle missing axes
2017-02-18 17:57:54 -05:00
28264156a0 fix for missing axes in scale animation 2017-02-18 23:40:09 +01:00
0c155267e4 fix for missing axes in position animation
fix animation exporter not being able to handle position animation with missing axes (e.g. an animation with only a curve for the X axis)
2017-02-18 23:39:38 +01:00
42f795b944 Merge pull request #53 from Hoikas/swimming
Swim Regions
2017-01-15 22:10:06 -05:00
a8f61e840f Allow referencing swim currents from python nodes 2017-01-15 22:07:53 -05:00
f45dd6f7fe Implement swim regions as a Swim Surface modifier 2017-01-15 22:07:53 -05:00
0c5361b4c7 Merge pull request #52 from dpogue/rt-light-fix
Fix backward lamp distance calculation
v0.05
2016-12-30 22:05:46 -05:00
8b450b6d68 Fix backward lamp distance calculation
When use_sphere is enabled, the lamp cutoff is at exactly the distance
value. Otherwise, the distance value is the point at which the lamp
intensity is half its starting value.

This probably doesn't match Blender 1-to-1, but it's closer to Blender's
lighting logic than the existing use_sphere calculations.
2016-12-30 18:14:13 -08:00
da53a81d9e Merge pull request #51 from dpogue/light-anim-fix
Fix exporting lamp animations
2016-12-30 17:45:54 -05:00
f2d415d14c Fix exporting lamp animations
If you had only transform animations on a lamp, it would still attempt
to unconditionally export colour/falloff animations.
2016-12-30 14:39:06 -08:00
0e90f79128 Merge pull request #49 from dpogue/extend-fix
Layers should also be clamped with EXTEND
2016-12-29 18:40:40 -05:00
dde0f16887 Layers should also be clamped with EXTEND 2016-12-29 15:37:04 -08:00
2b5fb98d3b Merge pull request #48 from dpogue/smoothing
Implement face flat/smoothing shading
2016-12-28 22:36:02 -05:00
ca3147865e Implement face flat/smoothing shading
Really I guess this is implementing non-smoothing, since we previously
treated all faces as if they had smoothing enabled.

It's technically a breaking change, but should make Plasma with runtime
lighting match what you'd expect from the Blender 3D viewport.
It also matches how PlasmaMax treats meshes by default with no smoothing
groups attached.
2016-12-28 19:32:02 -08:00
e991c4d134 Ensure the default export file's extension is .age 2016-12-26 19:58:37 -05:00
38eb0686ef Ensure detail textures use alpha blending 2016-12-26 19:41:34 -05:00
d40cd7c3ef Merge pull request #43 from dpogue/gl-fix
Fix case on GL include path
2016-12-26 17:10:59 -05:00
83d95356d7 Fix case on GL include path 2016-12-26 13:17:16 -08:00
6aad085500 Fix typo in the looping part of SoundMsg node 2016-07-22 19:49:02 -04:00
734fbadda8 Fix moronic typos 2016-07-20 20:02:39 -04:00
df056603ec Implement Layer SDL Animations 2016-07-20 19:41:45 -04:00
eefb40a30a Allow Z-flag toggling
Also, rearrange the layer panel to make a bit moar sense
2016-07-20 18:46:51 -04:00
e3f8f0863f Show Material Transparency panel in Korman mode 2016-07-20 14:51:55 -04:00