Sorry for not replying earlier to this topic, life's been keeping me quite busy lately...
cskid13 wrote:I would love to see this. In fact, I'd probably get back into writing if this existed.
Glad to hear it ! I just wish it were the case for more people...
Deledrius wrote:If you're going to work on a massive re-write of PyPRP to work with the newer Blender versions, it might be worth a look at starting from PyPRP2.
Isn't Korman intended to be the massive rewrite for newest Blender ?
No, the original idea was just feeding the scripts to a Python 2x to 3x translator, and then replace any call to Blender's API by their new equivalent (even though it was a bit more work than expected). AlcScript remains the same, and only minor changes in the interface are intended: either to rebind options to new buttons in Blender, or because I didn't like some options and wanted a simpler alternative*.
Rewriting it to use HSPlasma sounds like more work, and I'm not sure I want to bother.
However, I did have a look at PyPRP2 to get an idea of how to write plugins using the newest API... This was a time saver.
*:
For instance, shadow casting is off by default, since I never use it and it's annoying to untick the button. Plus, it makes it easier to bake lightmaps**. Of course, some people might not like these modifications, which is why they are contained to this version of PyPRP (working on two versions of PyPRP and two APIs is already complicated enough, which is why I don't create a separate branch for these modifications either).
**:
Ideally, the user wouldn't have to mess with Plasma's materials anymore, they would just setup the scene to render correctly in Blender, and my
lightmap baking script would take care of the rest. I'm in no rush to finish the script, though, since the topic didn't get much replies anyway.
Now, I finally uploaded the new files to
GitHub. Animations still don't work, but I fixed a few more things since the last post.
Here is a small guide to installing it (hopefully I made it simple enough for anyone to follow). Note: I tested it using Blender 2.71, it might not work with previous versions. Later versions should.
Installing PyPRP: First, grab the ZIP file from the GitHub repository, and uncompress it. Inside it, copy the PyPRP folder. Navigate to your Blender "addon" directory (C:/Program Files/Blender Foundation/Blender/2.71/scripts/addons), paste the PyPRP folder there.
Installing PyYaml and Pillow (previously PIL): Alright, I don't know the "proper" way to do this, but this one worked for me. (if anyone has a better idea, I'm all ears.)
The issue is that PyYaml and Pillow will only install on a "valid" Python install, meaning it probably won't like Blender.
Find the Python version used by Blender (change one of the views to "Python interactive console", the version is on the first line. Mine is 3.4.0, since it's Blender 2.71).
Download and install the Python installer for your version (don't forget: download the correct version if your version of Blender is 64bits). Install it anywhere you want.
Download PyYaml and Pillow (make sure they match the Python version used):
http://pyyaml.org/ https://pypi.python.org/pypi/Pillow/ Install these two.
Go to Python's installation directory (probably something like C:/Python 34). Open the "Lib" directory.
Copy the two folders: "PIL" and "yaml"
Now, go to your Blender install directory (something like C:/Program Files/Blender Foundation/Blender), browse to <Blender's root folder>/<Blender's version>/python/lib/,
and paste the two folders there.
Activating PyPRP in Blender: This is done the same way as it was done in PyPRP2. Change one of the views to "User preferences". Go into "Addons > Import-export", and find the one named "PyPRP exporter".
Tick the checkbox next to it, wait until it is loaded. Switch back to the 3d view, and hit Ctrl-U to save your preferences (otherwise it will be disabled once you restart Blender).
You should have a new export option, as well as two new menus in the Add menu.
(if not, click Window > Toggle System Console, there is probably an error message written in the window that pops-up)
Short guide to using it:Since a lot of Blender's interface changed, I had to find workarounds for some of the buttons that disappeared.
Also, I modified some of the default options. It was all done to fit my tastes, but you're welcome to suggest any change, of course.
Short list, from what I remember:
- ACTOR button (used to force the object to use a Coordinate Interface):
now bound to Object > Display > Axis. Animated objects should now automatically get a CoordinateInterface, to avoid unfriendly crash logs in-game.
- Object properties (type=region, etc):
now as custom properties in the Object panel
- Shadow casting is entirely disabled. People never understood they had to disable it, or always forgot to turn it off.
This can bring even the most recent computer to its knees. Since only kickables may have a reason to cast shadows,
the only way to enable them now is via AlcScript.
- Specularity:
now it's always disabled for shadeless objects, since it's quite heavy. To tell the truth I don't even know if it has a
performance impact when the object receives no light, but you know, "just in case".
- Lightmaps:
you must check either the "Ambient" or "Emit" button in the texture panel to enable them (I wasn't sure which was the most appropriate,
it was "ambient" before, but "emit" might look better in the 3D view...)
- Physics:
now in the physics panels (obviously). Making something collidable requires pressing the "Rigid body" button
(no, despite its name, it's not the "collision" button - it's tempting to use it, but it does not offer enough options such as friction).
Beware: by default, Blender's setup and how it's hooked to PyPRP makes the object a kickable. The object can be made static by
setting the type to Passive (or simply disable the "Dynamic" checkbox, that's 1 less click).
Don't forget to change the collisions type to "Mesh" for exact collisions.
- mesh faces:
no real change in the interface here. However, it's worth noting you can use polygons of any number of vertices now - it's no longer limited to tris and quads. UVs and colors will be handled correctly.
(this was a pain to code, the API modified a LOT of things around faces and UVs.)
- sum files:
these are now empty. Reason: I often modify my Ages after they are exported, and don't want to update them.
- not working yet:
animations will cause an error on export. Ladder regions might work, but AutoLadders will end up anywhere in the Age. Some other logic options might not work either.
Last note: in one of the Ages I exported with this version of the plugin, I crash whenever I switch to 3rd person with dynamic shadows enabled
To be able to use third person, I have to disable shadows in the F4 menu. The other Age is fine, though.
Does anyone know why ?