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

590 Commits

Author SHA1 Message Date
b2120aba10 Add new "nonfatal error" handling for exporter
There are some cases where errors, while bad, are not the end of the
world. I'm thinking namely about compyling the age python. The age still
exports just fine, but the ancillary data is flawed. This new system
collects nonfatal errors until the export is done, then raises them all
at once.
2019-01-11 00:43:25 -05:00
b6c9551883 PythonFile Node v2
Version 2 of the python file node is now backed by a `bpy.types.Text`
datablock in the case of a file whose attributes are updated from a
backing file.
2019-01-11 00:43:25 -05:00
e5b79bf6b5 Add Python packing operator
Implements the boilerplate code for compiling Python code in arbitrary
python versions and packing the marshalled data into Cyan's Python.pak
format. Since this is a lot of bp, a separate operator has been added
to both test the resulting mayhem and provide age creators an easy way
to export only their needed Python.

The only python that is packed currently is the age sdl hook file, if
any. In order for that part to happen, Python File nodes need to be
upgraded from having a string path to actually using the new text_id
field.
2019-01-11 00:43:24 -05:00
288058aa38 Refactor output file generation
Age output files are now handled in all aspects by a singleton manager.
This allows us to track all generated files and external dependency
files and ensure they are correctly copied over to the target game... Or
not, in the case of an age/prp export from the File > Export menu.
Currently only SFX files are handled as an external dependency. TODO are
python and SDL files.

Further, because we have an output file manager, we can bundle all the
files into a zip archive for releasing the age in one step. Wow such
amazing. ^_^
2019-01-10 19:50:01 -05:00
4d7c1cb58b Move Plasma Games to addon User Preferences
Plasma game installs are a per-user config item and should not be stored
in a blend file. Considering that we will be adding more per-user
configs, namely Python 2.[2|3|7] install directories, it seems like a
good move to go ahead and move the games over.
2019-01-10 19:50:01 -05:00
bb62fa7a4e Implement Korlib API versioning
A common error when developing with Korman and Korlib is to forget to
recompile _korlib on changes in the upstream C++ code. This will prevent
the errors from being catastrophic and will revert the user to the
python reference implementation with a minimum of fuss.
2018-12-21 22:58:57 -05:00
febfb3dd42 Fix issue with corrupted texture cache
If the texture cache doesn't return images in exactly the order or way
that libHSPlasma is expecting, it raises a RuntimeError. We can detect
that we used a cached image and regenerate the data in that case...
instead of just outright failing with "image data size mismatch".
2018-12-20 19:34:19 -05:00
cb54141af7 Fix :trollface: typo 2018-12-19 23:01:32 -05:00
ad99f496f0 Fix memleak in _korlib.create_bump_LUT() 2018-12-19 19:33:59 -05:00
070db331fb Merge pull request #125 from Hoikas/envmap
Environment Map Improvements
2018-12-19 19:32:27 -05:00
718791fff8 Fix some wording issues and typos 2018-12-19 18:26:11 -05:00
151c31f2e9 Implement cubemap generate operator
This operator takes a file as an argument and builds a cubemap from it.
Valid options are to supply the output from Plasma's
Graphics.Renderer.GrabCubeMap console command. The operator will find
the other five files and generate a cubemap with the faces saved by
Plasma. Otherwise, any arbitrary image can be supplied. If the filenames
do not fit the expected format, any missing faces will be replaced by
the face specified in the file selector. This will generally result in a
cubemap with six identical faces.
2018-12-14 22:59:57 -05:00
4a48f0da8d Implement cubemap export 2018-12-13 18:56:36 -05:00
035d79a7f6 Refactor image data handling for cube maps
Previously, we allowed OpenGL to generate all of the mip levels for us
in a mipmap. This was pretty doggone fast and worked reasonably well.
However, with cube maps, we will need to use images that are not always
backed in Blender... this is because Blender stores cube maps as one
single image instead of one image per face. So, we need to be able to
generate those mip levels, preferably without touching Blender's
`Image.pixels`, which is slower than Christmas...

Also of note... `Image.gl_load()` will actually scale the iamge to a POT
when Blender is using OpenGL ES... but not on other platforms. So, now,
we just ask Blender to load the image and deal with the POT-izing later.

The con here is that the pure python implementation of the image scaling
function is SLOOOOOOOW. We're talking ~40 seconds to process a 1024x1024
mipmap. No one should be using the reference implementation, however,
and the C++ implementation shows no noticable slowdown over the OpenGL
code.

Whew.
2018-12-13 18:38:07 -05:00
3ea2f973e2 Allow the image cache to store many images for one texture
Cube maps in Plasma are six separate images; however, Blender expects to
be supplied with one image that encompasses all of the cube faces.
Therefore, our texture cache needs to be able to support many images for
one request.
2018-12-13 18:38:07 -05:00
f9842789bf Add the ability to control dynamic envmap export
This provides the artist the ability to disable exporting layers that
would be DynamicCamMap (fast) in MOUL but DynamicEnvMap (slow) in PotS
in one fell swoop. Please note that disabling env map exporting will NOT
prevent waveset environment maps from exporting.
2018-12-13 18:38:06 -05:00
e7a42e6c2e Add enable/disable envmap toolbox operators 2018-12-13 18:38:06 -05:00
8c0396839b Fix issue with verbose logger not logging when there is no backing file 2018-12-13 18:36:58 -05:00
d75fd16b24 Fix some noisy tracebacks in the UI draw code 2018-12-11 00:00:22 -05:00
f95a9d34d6 Fix empty profile log files 2018-12-10 01:03:35 -05:00
eae02c133d Fix traceback introduced by 742baf3 when exporting to PotS 2018-12-06 20:39:18 -05:00
742baf338e Fix #116 2018-12-04 23:16:32 -05:00
c876e41ba7 Merge pull request #123 from Hoikas/mod-copypasta
Modifier CopyPasta
2018-10-23 19:40:57 -04:00
af16d58be5 Refactor some silly mod searches 2018-09-22 22:41:52 -04:00
e307c36a7d Fix #119
This adds the ability to copy and paste all modifiers (or a single
modifier) to another object.
2018-09-22 22:41:52 -04:00
0c8e333ad5 Fix overly explicit collider vertex export 2018-09-22 21:36:30 -04:00
3e90ac4727 Fix lightmap preview operator devilry
The "Preview Lightmap" operator no longer changes the active selected
objects or the active layer selection.
2018-09-18 20:41:14 -04:00
d16f064043 Fix incorrect path logic introduced in b588c87 2018-09-18 19:52:32 -04:00
734eb58819 Fix noisy tracebacks when not in Korman mode
Blender used to not specify COMPAT_ENGINES on the physics panels. It
does now, and the new poll methods are incompatible with ours. This
results in lots of noisy errors being raised when in Blender Render mode
with the Korman addon active.
2018-09-16 18:30:52 -04:00
b588c87234 Fix issue with texcache files on stale HDDs 2018-09-15 18:31:19 -04:00
f988a588ff Fix spurious assertion on blend load 2018-09-15 17:18:10 -04:00
15a16500e5 Fix issue with python files on dead HDDs 2018-09-15 17:17:48 -04:00
4523f5a2fd Merge pull request #122 from Hoikas/lm-passes
Add named lightmap passes
2018-09-15 16:51:40 -04:00
c0cdf46460 Generalize the lightmap modifier
The lightmap modifier is now a more general "Bake Lighting" modifier
that can control how vertex colors are baked as well. The default vertex
color baking behavior is unaffected. It is now identical to adding a
Bake Lighting modifier, changing it to bake vertex colors without
specifying a pass.
2018-09-15 16:50:24 -04:00
f94ef379d9 Swim Surfaces don't have to be flat 2018-09-10 20:56:00 -04:00
4779c8c710 Centralize lightmap render layer settings
This allows the artist to control what happens with lightmaps more
easily when there are lots of lightmapped objects in the age.
Fixes #118
2018-09-09 17:16:39 -04:00
a672db70a0 Merge pull request #121 from Hoikas/mod-versions
Modifier Upgrading
2018-09-09 17:16:20 -04:00
647c09e6e6 Implement modifier version upgrading 2018-09-08 20:31:13 -04:00
1f9a872afc Fix another dict check-key then add antipattern 2018-09-08 14:32:53 -04:00
67f2b907e0 Fix #120 2018-09-08 13:33:51 -04:00
2748bc2ab3 Merge pull request #117 from Hoikas/texcache
Texture Cache
2018-09-05 19:28:22 -04:00
fdc6ae3f22 Recache on file updates
Unfortunately, packed images don't appear to store any kind of modify
time attribute. In the case of those, we're just idly hoping that we can
find one on disk.
2018-09-05 19:24:31 -04:00
62f8b59ce2 Add per-image cache controls 2018-09-05 19:24:31 -04:00
72a4cf179e Add export-time texcache controls
Now you can turn off the texture cache entirely or force a recache of
the entire age... :)
2018-09-05 19:24:31 -04:00
2a49634e43 Update korlib for texture caching
Previously, the C korlib used a custom buffer class to avoid a memcpy
operation. However, pyMipmap expects binary string (PyBytes) objects, so
this changes the code to use them. Future work would be to continue
using PyBytes and removing the copy. For now, there are bigger fish to
fry...
2018-09-05 19:24:31 -04:00
654af0e56a Add rudimentary texture cache 2018-09-03 18:35:36 -04:00
eb622e5318 Prefer dict setdefault vs membership tests 2018-09-02 21:36:48 -04:00
7b5eb4f389 Fix "Compose Geometry" out of range progress steps
I like it when we're on step 13 of 7... :D
2018-09-02 21:35:51 -04:00
2b48c6dcc2 Replace a slow string search with isinstance 2018-09-02 21:34:42 -04:00
688407dc82 Ensure the export always has an active_object
Some operators, namely the bake operator, require there to be an
active_object. The lightmap operator manages the selection, so this only
fixes Blender whining about the context being incorrect due to a
technicality.
v0.07
2018-08-31 21:20:12 -04:00