SyntaxWarning: assertion is always true, perhaps remove parentheses?
assert is a keyword, not a function, and using it with parentheses
ends up being interpreted as a tuple argument (truthy) rather than a
boolean assertion and a message
If we're given a flat convex hull, we should *only* export the triangle
mesh. The convex hull setting is no longer relevant, and we should
discontinue that code path. Without this return statement, the convex
hull's vertices overwrite the triangle mesh's vertices, but the triangle
mesh indices remain. This can unlease an even worse variety of Satan
that will crash the gane.
The modifier was originally written with the assumption that exactly one
modifier controlled exactly one page. Of course, artists began using
multiple Note Popup modifiers to show the same GUI page in multiple
places. So, be sure that we only export the GUI objects once.
Weird feature request by artists. Korman's lighting equation selection
looks like it should work fine with this, though. The key is to be sure
that we don't pick up a stale autocolor layer.
the `pre_export_optional_cube_region` function is a decent idea, but it
predates the ability to do things like `foo = yield bar()` in
`pre_export()` generator methods. So, we remove it in favor of yielding
and assigning in one line. This should clean up some noisy warnings from
Blender after the export is over.
* Fix CubeMap Bug
* Adds a sanity check that raises an error if a CubeMap doesn't have an image.
* Refine coding
* Adjust a few things per Hoikas' suggestion
* Update korman/exporter/material.py
Fix line of code per Hoikas' suggestion
Co-authored-by: Adam Johnson <AdamJohnso@gmail.com>
* Update korman/exporter/material.py
---------
Co-authored-by: Adam Johnson <AdamJohnso@gmail.com>
Our calculations try to fill the entire screen with the GUI objects. So,
really, what we want the GUI Camera scaling to do is allow the artist to
make the GUI smaller onscreen by pushing the camera away. This is a
*less than* 100% scaling.
We will now calculate the area-weighted normal of all polygons in the
GUI page, then flip it to create the direction that the GUI camera
should face. This will, theoretically, be more intuitive to artists in
that the GUI camera should always point at what they've modelled instead
of imposing arbitrary rules on the coordinate system of GUI objects.
This adds just enough plumbing to be able to export GUI popup notes
using the standard xDialogToggle.py. There are still a number of TODOs
and FIXMEs in the basic stuff, but the design is mostly solid. The idea
is that you'll create a GUI page for any objects that need to appear in
a GUI. The GUI does not require an explicit GUI camera, however. For
now, an automatic GUI camera will be made facing the largest object's -Z
axis.
Blender's `bpy.ops.object.duplicate()` operator changes the underlying
object that's selected to be the duplicate while the code expected for
the underlying object to remain unchanged. This uses a lower-level ID
copy mechanism that should hopefully give the intended result.
There are some things that exist in `pre_export()`, eg animations, that
don't actually generate anything that needs to be memory managed. So,
it's ok if `pre_export()` isn't actually a generator function. It does
need to return either a generator or `None`, however.
It is now possible to write
```python
my_object = yield create_something()
```
to ensure that temporary objects are always managed by the exporter. Previously, the more verbose
```python
my_object = create_something()
yield my_object
```
was needed.
In an attempt to address #359, I separated 3D stereo sounds into
separate emitter scene objects and allow the engine to position them
around the listener such that the left channel is actually on the left
of the listener (and the same for the right channel). Unfortunately,
this did not fix the bug in question. However, the code that interfaces
with sounds from the outside is now much simpler, and the improved
behavior is a win, IMO, so let's keep this.
This fixes review comments left on #367 that were caused by missing
pretends-to-be-a semantics. `BMeshObject` is intended to provide
pass-through access to `bpy.types.Object`'s attributes.
Previously, the indentation level was hardcoded everywhere. This was
tedious before in that changing the log structure would require changing
many manual indentation values. Now that objects can be trivially
generated at export time, the export code might be much more nested that
before. So, it's better to let indentation be more implicit. This,
therefore, adds a context manager to increase the indentation using
`with` blocks. Manual indentation specification remains for
compatibility with Python 2.2 where required.
This adds a page type distinction. It will primarily be geared toward
things like GUIs and avatar animations. However, for now, we can abuse
it to allow externally created pages, such as those created by PRPShop
hacking (for particles) or from 3dsMax (avatar animations, GUIs, etc.)
to coexist more easily with our Korman-generated .age files.
These attributes are strings, not paths. It is safe to format with a
path -- paths are implicitly convertible to strings by formatters. We
use a `PurePath` because we only care about getting the string name and
not actually performing any path manipulation.
This fixes#334 by sorting everything before writing it out to the
localization file. Note that we need to sort each step along the way
because the nested dicts are not sorted by a call to `sorted()` - it
appears to only sort the key.
There were logic problems around exporting references to objects that
exist only in disabled pages (or default pages that are disabled because
no enabled objects are exported into the default page).
Exports a collider that should hopefully block only dynamic objects (kickables). Also, some formatting adjustments to the properties script to match others (this can be undone if wanted)