Page 4 of 5
Re: ZLZ PRP Importer
Posted: Sat Sep 05, 2020 7:52 am
by JulyForToday
Poking around this part of the forum, found this thread.
You might already be aware, but I figured it was worth mentioning.
For the most part ZLZ works rather well. Any time I've imported an age by Cyan it works fine.
But I've noticed that some weird things can happen with some fan ages.
If I import Chiso, or the GoMe Pub for example, here is what it looks like:
A bunch of objects are in the wrong place, many clustered near the world origin. Some of them are scaled oddly. Not sure what causes this.
Re: ZLZ PRP Importer
Posted: Sun Sep 06, 2020 1:47 am
by Doobes
Most likely due to those Ages being exported with Korman instead of 3DS Max. Not sure why that would make a difference though.
If you just wanted to play around with the blends to see my work under the hood, I'd be happy to furnish you with the originals.

Re: ZLZ PRP Importer
Posted: Sun Sep 06, 2020 5:55 am
by Maroonroon
Doobes wrote:If you just wanted to play around with the blends to see my work under the hood, I'd be happy to furnish you with the originals.

If you're agree, I'd like to have them too, please; it could help me to understand how to build a few things.

Re: ZLZ PRP Importer
Posted: Mon Sep 07, 2020 1:54 am
by Sirius
If it affects only colliders and regions, then that's a known bug. I already have a fix for it and tons of other things, but it's not yet available through the Wiki as I'm still working on it.
(Next version of ZLZ will require an updated version of libHSPlasma, which means I'll probably release it around the same time as the next Korman if everything goes well.)
Hopefully it's not too annoying

I recall there are less bugs with Ages from PotS, you can try importing the PotS version instead...
I'll also import those Ages with my current version to make sure everything goes as expected. As Doobes said, Korman and 3dsMax have subtle differences which may change how well Ages are imported.
I'm glad to see people using this plugin

Re: ZLZ PRP Importer
Posted: Mon Sep 07, 2020 6:37 am
by Maroonroon
Sirius wrote:I recall there are less bugs with Ages from PotS, you can try importing the PotS version instead...
I already tried to convert POTS version of ChisoPreniv, GoMePubNew and VeeTsah; same result:
JulyForToday wrote:A bunch of objects are in the wrong place, many clustered near the world origin. Some of them are scaled oddly.
Re: ZLZ PRP Importer
Posted: Mon Sep 07, 2020 12:54 pm
by Sirius
Okay, I tried importing the MOUL version of Doobes' Ages.
JulyForToday wrote:A bunch of objects are in the wrong place, many clustered near the world origin. Some of them are scaled oddly. Not sure what causes this.
I can confirm there is some issue with object transforms exported with Korman which still happens with my version of ZLZ. Noted, will find a fix for the next version.
(The rest of this post is just technical stuff...)
Korman exports object transforms into the icicles' l2w/w2l matrices for drawable objects without a coordinate interface. 3dsMax usually ignore those and bake transform directly into vertices. Should be simple to fix.
... Which also means I have proof that Doobes does not always apply scaling to his objects
I also noticed there is something funky with the MOULa version of VeeTsah. Theoretically its sequence prefix should be 40004 with a pageid of 1 for Temple.prp, but my version of HSPlasma instead reads it as -40260 and 33, which means ZLZ will completely skip importing it. Sounds like my version of HSPlasma still uses a wrong mask to read those IDs, but haven't digged deeper than this.
Re: ZLZ PRP Importer
Posted: Mon Sep 07, 2020 4:59 pm
by Tsar Hoikas
Sirius wrote:Korman exports object transforms into the icicles' l2w/w2l matrices for drawable objects without a coordinate interface. 3dsMax usually ignore those and bake transform directly into vertices. Should be simple to fix.
I think I remember making the decision to do this. IIRC I didn't want to waste time doing that per-vertex in Python, which would slow down the already slow exporter even more. Maybe one day, when the mesh exporter is rewritten in C++.
Re: ZLZ PRP Importer
Posted: Thu Oct 07, 2021 10:17 am
by Sirius
Just a heads up: ZLZ is still being improved from time to time. The current version is now able to setup most Korman 0.12 modifers (ladders, audio, swimming, grass...), and has tons of bugfixes. I'll keep updating it whenever new versions of Korman are released (although I'll probably lag behind a bit

).
The download link now always points to the latest version on the Git repo (actually it has been the case for a while now). I just updated the Wiki entry to give new instructions on how to install it.
A few of the latest improvements from roughly ~1 month ago:
- Show Spoiler
[list][*] multi animations, loop markers, sound volume anim. Still far from perfect, but should make reexporting easier.
[*] grass shader
[*] decals (print & receive)
[*] projected lights
[*] material pass index, render pass, face sorting
[*] import existing lightmaps as a Korman pre-baked LM
[*] improvements to cubemaps/dynamicenvmap/dynamiccammap
[*] improvements to how textures are imported in general, support for HD textures[/list]
Some details about texture formats and HD textures:
- Show Spoiler
[list]
[*] When an Age is exported, source textures are compressed using a destructive format: DDS (DirectDraw Surface). This means they are optimized for in-game use, but get some additional compression artifacts which cannot be removed. They might also be resized to a smaller size than the source image.
[*] Because of this, each time you import then export an Age/texture, the quality of image textures decreases.
[*] From now on, ZLZ allows you to specify the "MOUL source textures" folder before import. What is this ? It's the location of [url=https://github.com/H-uru/moul-assets]the MOUL source assets[/url]. When encountering a texture in the PRPs, ZLZ will instead use the original texture that Cyan released. This means that textures will have less compression artifacts when re-exported, on top of being higher-resolution.
[*] If this folder is not specified, ZLZ will instead use the texture found in the PRP "as is", which means it's in DDS format and already lower quality. When re-exporting, Korman will usually re-compress the image again, further worsening the compression artifacts. Some 3D game engines can however use DDS images without recompressing them, although it's getting less and less common.
[*] If you really dislike the DDS format, you can instead ask ZLZ to extract textures as PNG. PNG is more compatible and lossless, but will still contain the DDS artifacts and takes more disk space.
[*] DDS files can be viewed with the great [url=https://www.xnview.com/]XnView[/url]. Gimp also has plugins to handle DDS files, if you want to edit an image. When editing a DDS file, do not save it as DDS again - you would only add to the compression. Use a lossless format like PNG instead.[/list]
If you already have an Age imported with ZLZ, and want to use Cyan's higher-res source textures instead, you might try out this script... (this might be of interest to you, Doobes)
- Show Spoiler
To use the script:
- (As usual, make a backup of your file, just in case.)
- Unpack all textures from your file beforehand, again, just in case.
- Copy and paste the following script in a Blender text file.
- In the code, change the "sourcePath" variable to the "tga" folder from the "moul-assets" repository on your computer.
- Toggle Blender's console so you can check the progress, then run the script. It can take a minute or two.
- Make sure there are no errors printed in the console.
- As a bonus, this correctly setups texture detail blending, which will now be visible in Uru (the downside is it won't be visible in the editor anymore, but at least now it exports correctly).
[code]
import os, bpy
from pathlib import Path
# CHANGE this to the path to the "sources\textures\tga" in the "moul-assets" repository !
sourcePath = r"C:\somewhere\moul-assets\sources\textures"
# find the textures using each image
imgTextures = {} # Blender image: [textures using this image]
for tex in bpy.data.textures:
if tex.type == "IMAGE":
l = imgTextures.get(tex.image)
if l is None:
l = []
imgTextures[tex.image] = l
l.append(tex)
print("----------------------------------")
for img in bpy.data.images:
file = os.path.splitext(os.path.basename(bpy.path.abspath(img.filepath)))[0]
detailsStart = file.find('@')
if detailsStart != -1:
print("Has detail blending: " + file)
# paramsString = file[detailsStart + 1:].split('&');
# uh oh, actually, I forgot ZLZ completely screws up texture names...
# Fortunately everything following the @ is fixed-length, so we can find a workaround
details = file[detailsStart + 1:]
paramsString = [
details[:2], # mixMethod
details[3:7].replace('_', '.'), # dropoffStart
details[8:12].replace('_', '.'), # dropoffStop
details[13:17].replace('_', '.'), # maxDetail
details[18:22].replace('_', '.'), # minDetail
]
if len(paramsString) != 5:
print("WARNING: texture '{0}' blending: invalid number of arguments.".format(file))
continue
# eg name: dsntRockWallDark*0#0@al&0.00&0.10&0.60&0.00
mixMethod = paramsString[0]
dropoffStart = float(paramsString[1])
dropoffStop = float(paramsString[2])
maxDetail = float(paramsString[3])
minDetail = float(paramsString[4])
textures = imgTextures.get(img)
if textures is not None:
for tex in textures:
tex.plasma_layer.is_detail_map = True
tex.plasma_layer.detail_fade_start = dropoffStart * 100
tex.plasma_layer.detail_fade_stop = dropoffStop * 100
tex.plasma_layer.detail_opacity_start = maxDetail * 100
tex.plasma_layer.detail_opacity_stop = minDetail * 100
file = file[:detailsStart]
# screw the _0_0 suffix
i = file.rfind('_')
if i != -1 and file[i+1:].isdigit():
j = file.rfind('_', 0, i)
if j != -1 and file[j+1:i].isdigit():
file = file[:j]
found = False
fileTga = file + ".tga"
path = Path(sourcePath)
for matching in path.rglob(fileTga):
found = True
img.filepath = str(matching)
print("Replaced: " + file)
break
if not found:
print("Not found: " + file)
[/code]
Hmm, that should be all. ZLZ still isn't perfect, so as usual don't hesitate to report bugs. I'm glad to see people use it every now and then

Have fun !
Re: ZLZ PRP Importer
Posted: Wed Oct 13, 2021 5:17 pm
by Chacal
Thanks for doing this. I've made a note to go and try it.
Re: ZLZ PRP Importer
Posted: Fri Mar 11, 2022 12:50 pm
by Emor D'ni Lap
Hello Sirius!
Thanks for all your work on the ZLZ Importer over the years!
I have a couple projects that require importing individual .prps, and had used the PyPRP importer in Blender 2.49B very successfully doing that.
So when I read that your newer version running under 2.79B now has the ability to import individual .prps, I installed it. However, my imports are failing. And I’m sure it’s due to some bonehead move on my part (or something obvious that I’ve overlooked).
This issue may be partially due to an inability to set the texture source in the importer’s designated slot.
Clicking on the folder icon adjacent to that slot, I get this error:

I’ve tried copypasting the folder path of my saved comprehensive .tga textures from the Intangibles dump...but ZLZ declares it somehow invalid.
- Show Spoiler
ZLZ Uru Importer: Be Invoked !
WARNING - MOUL source textures path is invalid. It is recommended you set it to get better quality on imported textures.
Changing Blender's framerate to 30.
WARNING - importing single PRPs is very likely to break some references. Never use it if you intend to re-export the Age.
--------------------------------------
---> Importing E:\GAMES\MOULa\dat\city_District_canyon.prp
Import as PRP: .age file present, this should somewhat reduce the number of broken cross references...
Age name is city
Importing page canyon
694 objects
DAG zero... not allowed to happen!
15Stairs05
Traceback (most recent call last):
File "E:\GRAPHICS\Blender2_79b\blender-2.79b-windows64\2.79\scripts\addons\korman\properties\prop_object.py", line 24, in _enabled
self._init(context)
File "E:\GRAPHICS\Blender2_79b\blender-2.79b-windows64\2.79\scripts\addons\korman\properties\prop_object.py", line 34, in _init
num_layers = len(o.layers)
AttributeError: 'NoneType' object has no attribute 'layers'
File "E:\GRAPHICS\Blender2_79b\blender-2.79b-windows64\2.79\scripts\addons\korman\properties\prop_object.py", line 21, in _enabled
15StairsCrack01Decal
OBDKCrtRail03
Layer Map__648: not importing rotation
Traceback (most recent call last):
File "C:\Users\XXXXX\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\zero_length_zenith\importer.py", line 167, in execute
self.performImport()
File "C:\Users\XXXXX\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\zero_length_zenith\importer.py", line 276, in performImport
self.importPrp(filePath)
File "C:\Users\XXXXX\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\zero_length_zenith\importer.py", line 425, in importPrp
self.sceneImporter.importScene(location)
File "C:\Users\XXXXX\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\zero_length_zenith\sceneImporter.py", line 103, in importScene
self.parent.objectImporter.createObject(sceneObjKey)
File "C:\Users\XXXXX\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\zero_length_zenith\objectImporter.py", line 73, in createObject
blDraw, drawMatrix = self.parent.drawImporter.importDraw(sceneObjKey, drawKey)
File "C:\Users\XXXXX\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\zero_length_zenith\drawImporter.py", line 412, in importDraw
bpy.ops.object.plasma_modifier_add(types="blend")
File "E:\GRAPHICS\Blender2_79b\blender-2.79b-windows64\2.79\scripts\modules\bpy\ops.py", line 189, in __call__
ret = op_call(self.idname_py(), None, kw)
TypeError: Converting py args to operator properties: enum "blend" not found in (, 'animation', 'animation_filter', 'animation_group', 'animation_loop', 'laddermod', 'sittingmod', 'imagelibmod', 'journalbookmod', 'advanced_logic', 'maintainersmarker', 'soundemit', 'spawnpoint', 'c)
location: <unknown location>:-1
location: <unknown location>:-1
And the ZLZ texture importer only seems to go to the first .age it can find in my MOULa folder, which is Ahnonay of course... but that also fails. I can give you the log info on that as well if it helps.
p.s. - obviously, I’ve used the second of the installation-location options in your wiki page.
And yes, as you recommended I am running Blender in admin mode for this purpose.