This fixes two bugs with empty node socket spawning:
- The first time an empty is spawned, the link is moved to the last
socket.
- Unlinking a socket in the middle of the group would cause that socket
to be the one that's empty. This isn't bad per-se, but with Responders
being ID-based, it could result in some confusion.
Previously, reusing node trees required careful thought and
specification of specific nodes in the advanced logic modifier. This
tedious requirement has been removed in favor of ensuring that the nodes
themselves take into account whether or not they should generate and
attach plasma objects.
This fixes an issue in which responders would get "stuck" at the end if
the last message had callbacks AND the responder was not attached to a
Python node.
Inspired by Unreal Blueprint's drag link+create list functionality. I
realize Blender has a few operators that do different parts of this job,
but they don't provide this well-polished functionality.
"Improve" is not quite the correct verbiage here because there were bugs
in the old code. The main issue is that any SceneObject with a
plPythonFileMod attached MUST have a CoordinateInterface attached,
otherwise the object would be invisible in game. Further, there were
some unreported oversights with regard to auto-generated modifiers that
have been fixed.
Due to memory management issues, it is likely impossible to remove a
node in its own init() callback without crashing Blender. Now, we will
deactivate any output node operators if an output node is already
present in the tree.
Recall that PFMs are added as modules to the global modules dict.
Therefore, module names must be valid Python 2.x identifiers. This is
handled well for age names, but we've been neglecting to handle it for
PFM names. So, when Blender adds ".001" as a suffix to a duplicated
object, any attached PFMs will go down in a firey dust explosion.
Generally, with the unhelpful error message: "NULL result without
error in PyObject_Call".
See the comment for details. I've been seeing this crash since we
started doing fancy idprop stuff. Of course, my test blend has always
had bleeding edge junk and has crashed left, right, and center. For more
fun, follow the progress on D4196.
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.
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.
Pull request #114 was causing messages that could wait but had no child
messages to always have waits generated for them. This was causing some
responder states to never be marked completed. This ensures only
messages that need to be waited on have waits generated for them.
Messages that must be waited on include:
- the last waitable message if the responder is attatched to a PFM
- the last waitable message if it's the last message in the state
- any waitable message that has a child message
What was previously marked as transition cuts would really only cut goal
and POA tracking. Transition cutting requires the addition of a
transition ovveride. The engine supports cutting transitions on
plCameraMsg receipt by the virtual camera. The option looked sloppy on
regions (and should probably be controlled in the transitions), but it
has been added to camera message nodes for more control.
In order for a python script to be notified that a responder attribute
has finished executing, we have to have a callback notify message in the
responder state. Cyan seems to require the artist to do this by hand,
but that seems like such a common operation that we'll add a callback at
the end of every state of any responder linked to a Python node. Cyan's
approach is somewhat more flexible in that you can call back at any
point in the responder, but that seems a bit excessive.
This introduces the ability to version nodes. Responders have been
bumped to version 2. The difference is that v2 responder nodes maintain
a list (hopefully) all responder states on the responder itself. Each
state has its own socket and displays its index for usage in python
scripts. For better predictability, any states that are only linked to
another state's gotostate socket will be exported at the end of the
state list.
Adds a framework for dealing with deprecated logic nodes. First
implementation is for Responder Commands, which hooks the messages
directly onto the Responder States. Note that the old socket definitions
are left alone because the upgrader will need that data.
This commit removes the ability for Responder State nodes to specify
Responder Command nodes. Now, Responder State nodes reference Message
nodes directly. Messages that support sending callbacks can now
reference other messages as linked outputs.
Note that old node trees are currently broken and will need to be
reworked by hand. TODO is to automatically upgrade those old command
based node trees. Also, LOGICWIZ code using command nodes needs to be
updated.
As it turns out, enumerating a collection that can be modified is a bad
idea. Indeed, Blender expects that we won't do this. Sometimes, it
appears to work, however, other times, Blender is unable to handle it
and the internal data gets corrupted, causing a crash.
Parses and loads the PFM arguments into accessible properties, used
by numeric nodes for range, dropdown nodes for enums, etc.
Also moves PlasmaAttribDropDownListNode into its proper alphabetical
position.