h-uru / korman Goto Github PK
View Code? Open in Web Editor NEWBlender plugin for creating ages for Cyan Worlds' proprietary Plasma engine and its open source variant, CyanWorlds.com Engine.
License: GNU General Public License v3.0
Blender plugin for creating ages for Cyan Worlds' proprietary Plasma engine and its open source variant, CyanWorlds.com Engine.
License: GNU General Public License v3.0
Blender supports reloading scripts by pressing F8
, but Korman currently does not work with this feature. It would useful to have this working for quicker iteration during development.
Exception in module register(): 'Blender\2.78\scripts\addons\korman\__init__.py'
Traceback (most recent call last):
File "Blender\2.78\scripts\modules\addon_utils.py", line 350, in enable
mod.register()
File "Blender\2.78\scripts\addons\korman\__init__.py", line 38, in register
bpy.utils.register_module(__name__)
File "Blender\2.78\scripts\modules\bpy\utils\__init__.py", line 667, in register_module
raise Exception("register_module(%r): defines no classes" % module)
Exception: register_module('korman'): defines no classes
When a texture image has been erased from the HD and cannot be loaded, the exporter yields a visible Python traceback. It confusingly comes from helpers.ensure_power_of_two
deep inside the material exporter.
Currently, sanity checking and exporting happen in the same step. Due to the arbitary order of the export process, this causes sanity checking to be duplicated in many locations. Perhaps a new step in the exporter that calls each object's (and its modifiers') dedicated sanity check routines should be introduced. Furthermore, modifiers need to have better error reporting facilities, much like the raise_error
method on Nodes.
The verbiage in the logic node system's sockets is somewhat arcane. It needs to be refined into more user friendly terminology. Tangentially related is #36.
Korman's find_key
implementation currently uses libHSPlasma's string search mechanism. Profiling shows this is somewhat slow, therefore, we should either rewrite the libHSPlasma code to use a hashtable or maintain a dict of keys in Korman itself.
libHSPlasma Tasks:
Korman Tasks:
The journal modifier should be updated to allow the user to list images they would like to be able to use in the journal's PBML. This should automatically export a plImageLibMod so those images will be properly loaded by the engine.
Should be able to set the specular colour/"specular power" on a layer.
Again, Blender handles this at the material level, and it should really be handled at the layer level in Korman.
CWE now supports PNG mipmaps. Therefore, it would be a filesize win for us to compress lightmaps as PNGs for export to MOUL.
Including straight swim and current
As reported by J'Kla on the forum, the new Ladder Modifiers do not export correctly for use in The Path of the Shell. Both the top and bottom regions appear to be at the Age's origin instead of their correct positions. I've confirmed the bug, but cannot determine the cause.
Plasma's way of doing this isn't totally straight forward, and I'm not sure how it would end up hooking up in Blender.
As of Blender 2.78, random error messages are spewed into the console during export. They seem to only occur for lightmapgen materials.
Error in remapping process from 'GR_LIGHTMAPGEN_*`: ... wrong user count ... (summing up to -1)
Apparently, ptAttribDropDownList
support was never added to Python nodes, and it is used by some standard Python files, notably xFogSet.py. Some work will need to be done to store the values in attribute nodes. A bare-bones implementation (sans drop-down) can be found in 9b1a6d7
Currently, static lighting is baked before any object modifiers are applied. This works 99% of the time, however, when procedural modifiers such as the Array modifier are applied, the lighting is only generated for the source data and not for the resulting procedural content.
See also:
https://forum.guildofwriters.org/viewtopic.php?p=71401#p71401
The 3D-ness of a sound emitter is unrelated to its type (Ambience, Music, GUI, etc.)
Investigate the ability to create python packages as part of the age export process. This would possibly entail changing the exporter to take a directory and spewing the exported age data there**. See also #34 -- could possibly bundle some nonstandard scripts for PotS compatibility such as the journal template script.
** Related: could use Uru directories to parse GlobalAnimations to get animation marker points for OneShot and other logic nodes, preventing common errors.
With the pending addition of the Plasma... Add
menu from #44, we can generate pre-fabricated mesh guides, with pre-configured Plasma modifiers and complicated node trees, all perfectly measured to conform to the existing animation assets and allow artists to spend more time building and less time looking up recipes and reference material.
Work toward deprecating the Responder State node and move toward implicit responder states built from command linkage. This will ideally make the logic node tree easier to follow. Will also need to build in a framework for detecting deprecated node types on load and upgrading them on-the-fly. But that shouldn't be too hard.
Textures and geometry are being exported, but when I link to an age with a simple textured plane and spawn point, the textured geometry is not visible. The expected data is in the PRP files and generally appears to be correct.
Journals are common, so let's have a dedicated journal modifier instead of requiring the artist to hook up Python nodes for this.
Korman detects when lamps should be projection lights, but it does not export the Plasma Layer. This is due to assumptions in the material exporter that all layers are owned by an hsGMaterial.
Animating the energy on an omni lamp will create a plOmniSqApplicator, which is correct for MOUL but that class doesn't exist in PotS. The result is that libHSPlasma writes a null creatable (0x8000) for the AGApplicator and the exported files cause other tools to crash.
We should either only generate the OmniSqApplicator for MOUL-compatible exports, or have some step in libHSPlasma to filter out unsupported classes without writing nulls.
Implement an avatar ladder modifier using MultiStageBehMod
As of right now, the logic nodes only supports the detection of avatars inside conditional objects. This should be expanded to, at bare minimum, moving other arbitrary objects inside of conditional spaces eg as seen in the Teledahn Prison. Some investigation will be required to determine how to work around the collision member group limitations introduced in CWE from ABM/PotS.
Further work would be to implement the boolean AND/OR conditional objects.
Currently, all modifiers that maintain lists must reimplement the UI code. This is annoying. We should have one list helper class that is smart enough to handle several cases. Plain old data and object lists. Object lists need to do some verification to make sure that the object has the correct modifier, if needed. This will help the user understand if there are problems before the export happens.
Presently, Responder State nodes are linked to a single output node on the Responder. Additionally, they can be linked to one another and theoretically be included in the Responder. While this is sufficient for general use cases, for Responder states to be used in Python via ptAttribResponder
, the Responder State's index must be known by the Python script.
I envision this being fixed by removing the States output node and replacing it with a single node socket that only accepts one state. The socket will report the Responder State's index for use in scripts. Additionally, states MUST be connected to the Responder's output in order to be exported. States can still trigger other states, however, this will be done via a different node socket.
There are cases where DynamicEnvMaps/CamMaps don't work, namely that they can't render to themselves.
These are required for complex behaviors
The current texture export management is very naïve. We determine the settings for a particular texture image the first time it encounters it by checking the Use Alpha
and Calculate Alpha
user inputs. If those inputs change, we're out of luck because the texture's already been exported that way. These inputs are also somewhat confusing to the user (there are two "Use Alpha" buttons).
The aspect of the current system that I am happy with is the use of the DDS and BMP extensions to indicate the plMipmap's internal compression format.
Korman currently exports all objects in a blend file marked as Plasma Object. With the introduction of ID Properties, objects removed from the scene might not be removed from the blend due to references from other objects. As part of the export, we need to ensure only objects in valid scenes are exported. We should probably also investigate warning if we try to export a reference to an object that is either not a plasma object or not in a valid scene.
See also https://forum.guildofwriters.org/viewtopic.php?f=10&t=6946
Korman has gotten to the pointer where it is a large, complex program with many facets that are difficult to naively test. As a first step, we need to begin assembling a library of in-repo packed blend files for the purposes of testing Korman's features.
Images are exported upside down due to being rammed through OpenGL. We correct for this by transforming UVs, however, this is not possible for things like linking panels and journal book covers and therefore introduces a gotcha for cases luch as linking panels and journal covers.
Add support for subworlds to Korman. This should include logic to handle exporting no arbitration volume sensors where available to avoid "falling through the floor" bugs. Also, to be investigated is the relevance of RidingAnimatedPhysicalDetectors for having dynamic avatar controllers.
Exporting an age with textured objects twice in the same Blender session causes Blender to crash. My limited debugging indicates that it is a result of an Access Violation in PyHSPlasma's pyKeyedObject_getKey
on a plMipmap
instance.
Now that we have basic modifier support, the next step on the agenda is to have simple physics modifiers, such as colliders and avatar footstep regions. More advanced options should wait until we have logic nodes ready to go.
This depends on code from @Deledrius to bake convex hulls in libHSPlasma.
Should be able to set a layer to be pre-lit with ambient/emissive colour. Tricky part is that Blender handles emit at the material level, and in Plasma it should be done at the layer level.
I have some ideas here with the Blender Texture mapping ramps, but it might not be especially intuitive :\
Convert usage of os.path
to the absolutely amazing and newfangled pathlib
.
Per @Jrius in #93 and on the forum, Plasma engines that utilize Havok physics expect for most static physicals' data to be in worldspace coordinates while others (specifically pinned and massed physicals) are expected to be in localspaced. Korman currently exports physical data in localspace coordinates only, which works on MOUL.
A work-around for ladders was introduced in #94 to apply the kPinned
flag and a mass of 1.0 to the physical. However, this does not address the fact that we are producing physicals that are potentially incorrect for PotS. We should investigate either applying transforms as a post export step on these physicals or applying this workaround to all PotS physicals.
Regardless of whether I select an ogg or wav file, the exporter always uses the .ogg extension for the plSoundBuffer's filename field. Since it does not convert the wav to an ogg, this leaves a non-working plSoundBuffer unless the user manually compresses and installs the sound files.
Setting up stencil layers with the blend ramp by hand kinda sucks, and you need to make sure to get the flags right.
PlasmaMax has a feature to allow artists to use vertex colour layers to define the blending stencils. Somewhere back in the pyprp days, either Nadnerb or myself (or both?) wrote a script to turn a VCol layer into a UV mapping for a stencil, but it wasn't automatic and could easily get out of sync.
My proposal is that we add a field to the per-layer Plasma panel with a checkbox for "Use vertex colour blending mask" and a select box for which VCol layer to apply as a stencil. At export time, this would automatically create the blending layer with the right texture, right flags, and UV coordinates.
For simplicity, we'd handle the VCol colours the way we do for alpha: a range from white to black.
The various Water modifiers that export to a Plasma plWaveSet7
do not have documenting descriptions. These would be useful for improving the usability of these modifiers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.