ross-g / io_pdx_mesh Goto Github PK
View Code? Open in Web Editor NEWImport/Export files for the Clausewitz game engine
License: GNU General Public License v3.0
Import/Export files for the Clausewitz game engine
License: GNU General Public License v3.0
Hey there, hopefully your still responding to people on here, been trying to get into eu4 modding and was attempting to install this for Blender. Everytime i add it to my Add-ons it comes up with this message when i attempt to check the box.
No idea how to fix this and it would be amazing if you could push me in the right direction. Thanks :)
Python: Traceback (most recent call last):
File "C:\Users\xxxx\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_pdx_mesh\pdx_blender\blender_ui.py", line 374, in execute
bonespace=self.chk_bonespace,
File "C:\Users\xxxx\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_pdx_mesh\pdx_blender\blender_import_export.py", line 1177, in import_meshfile
asset_elem = pdx_data.read_meshfile(meshpath)
File "C:\Users\xxxx\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_pdx_mesh\pdx_data.py", line 241, in read_meshfile
raise NotImplementedError("Unknown file header. {}".format(header))
NotImplementedError: Unknown file header. (b'm', b's', b'1', b'1')
location: :-1
Hey Ross, great work on this plugin, I've been using it to throw together some things.
I've noticed that on the two newest ship sets (that is, Lithoids and Necroids) and some ship types (all Titan class ships) the "frame" import appears to be missing some relevant data. I believe this to be down to Paradox subtly changing the format and may need updating your end (unfortunately I have no way of reading the .mesh format directly to be sure).
To fill you in brief, these mesh files (e.g. \Stellaris\gfx\models\ships\mammalian_01\mammalian_01_battleship_frame.mesh
) contain information pertaining to the location of each given segment of a ship type in relation to each other on any ship with three segments. Cruisers, Battleships and Titans have these meshes. You almost certainly already knew this but it's important for the framing.
In all ship sets including the Humanoid and Plantoid addons, the frame
mesh is imported as a series of locator empties and an armature including three bones. The typical layout for a given ship frame when it works as expected is:
io_pdx_rig
--Pose
--Imported_armature (which may or may not be linked to the locator transforms below, seems it should be linked?)
----(skipped for brevity)
--Explosion_locators (multiple, skipped for brevity)
--part1_locator
--part2_back_locator
--part2_front_locator
--part3_locator
However for the newest two ship additions we do not have this structure, in fact it appears it's missing or corrupted. The one instance I've found where we do have a locator (necroid_01_battleship_frame.mesh
) it's part2_back
and is given the wonderful maximised y
position of 831690816 m
and the xyz
scale of 100000000
on all axis.
Edit: Seems that Humanoid ships are also corrupted, so we get all the locators but their locations are wrong.
It's the fact these values are maximised which makes me think it's a format issue. I'd submit a PR but I'm not too comfortable with Python, let alone Blender scripts.
Let me know if there is anything I can do to help here.
Thanks.
Mesh doesn't include vertex groups with some error texts,
I'm with 0.7, in blender 2.81.
here's the error messege.
Mesh import failed!
'NoneType' object has no attribute 'inputs'
Traceback (most recent call last):
File "C:\Users\Ronald\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_pdx_mesh-master\pdx_blender\blender_ui.py", line 387, in execute
bonespace=self.chk_bonespace
File "C:\Users\Ronald\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_pdx_mesh-master\pdx_blender\blender_import_export.py", line 1122, in import_meshfile
create_material(pdx_material, mesh, os.path.split(meshpath)[0])
File "C:\Users\Ronald\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_pdx_mesh-master\pdx_blender\blender_import_export.py", line 671, in create_material
shader = create_shader(PDX_material, shader_name, texture_path)
File "C:\Users\Ronald\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_pdx_mesh-master\pdx_blender\blender_import_export.py", line 624, in create_shader
links.new(albedo_texture.outputs['Color'], shader_root.inputs['Base Color'])
AttributeError: 'NoneType' object has no attribute 'inputs'
location: :-1
Hello,
I can't tell where this issue comes from, maybe D3D engine, maybe the exporter. I tried to narrow it down as much as I could on my end.
Complete report here that I also sent to PDX : ElTyranos/CommunityFlavorPack#29
Regards,
ElTyranos
I was playing around loading and exporting CK3 vanilla models for testing purposes when I came across a problem.
Operator bpy.ops.object.select_all.poll() failed, context is incorrect
Traceback (most recent call last):
File "C:\Users\zumba\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\io_pdx_mesh\pdx_blender\blender_ui.py", line 516, in execute
merge_verts=self.chk_merge
File "C:\Users\zumba\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\io_pdx_mesh\pdx_blender\blender_import_export.py", line 1245, in export_meshfile
bpy.ops.object.select_all(action='DESELECT')
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy\ops.py", line 201, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.select_all.poll() failed, context is incorrect
location: <unknown location>:-1
I'll attach meshes I'm trying to export.
prophet_shield.zip
Mesh.calc_tangents(): required parameter "uvmap" to be a keyword argument!
What can I do to deal with it? I really want to export something but I just can't understand what the debug meaning QWQ
Whenever I export a model with "merge vertices" option in blender, this error messages shows up in the error log.
Yet when I open the .mesh files with blender they have same amount of vertices/edges/faces.
Can you add feature to export selected only meshes
Don't panic I'm not expecting anything fixed for an expansion that just came out. Just a heads up that trying to import the animation for the new Star Eater class causes some heavy glitching of location on playback. I'm not in a position to record a video right now sorry.
Key thing is that it, on testing, seems to only apply to the Star Eater, but it may indicate more changes in their pipeline down the line, or maybe a special case.
Only seems to apply to the Opening and Closing animations, however the "open" animation also seems to be incorrect - there should be movement that isn't present. Fixing one will probably fix the others.
I'll append a video when I can.
Hey Ross,
is there some sort of mesh limit loading into blender ?
the .mesh file hast 116 meshes and load ingame fine, but if i try to load it into blender it only loads 100 meshes.
G'day, here's the issue that I found when importing and exporting an Imperator:Rome model.
This is the issue in the screenshot. After importing and exporting this port, the ship docked in the port is oversized (ship to the right). They should be small and visually fit inside the tiny port model (the port model is to the right of the big ship).
Here are the steps that I took.
Import the game model gfx\models\buildings\eastern_port\eastern_port.mesh
With no changes or edits, export the file, overwriting the game model.
In game the ships docked in the Eastern Port are oversized.
This issue also occurs with a custom model, created in Blender with either a copy of the ship_locator empty or a new empty named ship_locator.
I have attached the .blend file of the imported eastern_port model. I can also attach the complete folder with the textures and .mesh or my custom model (Carthage Great Harbour).
Eastern Port.zip
I tried to add this myself but I'm frankly still crap at Python. Hoping it's not too bad a job...
As expected by me - and correct for the code as written - you cannot import multiple animations into one scene if there are more than one rigs available.
So, for example (it's me, so Stellaris):
io_pdx_mesh/pdx_blender/blender_import_export.py
Line 1344 in 7b41ef0
My request is that this area of code is changed such that it attempts to apply to the current actively selected rig/armature (if any) before searching the whole scene for them. I'm a realist so not asking for any kind of UI for it, documented functionality would do plenty!
Thus my workflow would be:
I'm working around it right now by scene linking (applying the animation separately and importing them to the scene I need them to be). Functionally I don't think there is any direct limitation for this, just searching the selection before scene in get_rig_from_bone?
I figure if someone tries to apply the wrong animation to the wrong rig they should expect busted behaviour. Don't need to error check it too much.
Thanks Ross!
Here we go again! The previous fix did indeed fix the locator issue, however today I ran into this issue:
This one happens once I deleted some meshes and locators from a bigger master file to create mesh variations. The failing file can be found in the attachments. It also creates a corrupted in-game file with borked locators so it is kinda serious, again. ๐
EDIT: I just tested and confirmed that this issue happens with v0.7 as well.
Hey, I am trying to install the addon into blender but I keep running into this error when trying to enable it:
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\modules\addon_utils.py", line 382, in enable
mod.register()
AttributeError: module 'io_pdx_mesh' has no attribute 'register'
Any idea what the cause might be?
Hey Ross, love your tool first of all!
I have an error using the tool for Maya while exporting. It goes:
" Mesh export failed! ... Maya Node does not exist (or is not unique):: u'None' "
I'm using Maya 2020, I have a friend who uses an older version of Maya and it works for him. Do you know the specific problem with this?
Even with "Selected Only" and having only selected the desired locators, the plugin still exports EVERY empty in the scene, which means you have to temporarily delete every other one or move that which you are trying to export to a new file just to cleanly export.
Hey Ross,
A friend and I have been trying to make custom models and animations for Stellaris mods using your plugin, but we keep running into a wall. There are .mesh files with "frame" in them and upon importing they look something like this (depending on which one, in this case a mammalian battleship frame):
These frames are required to make new models and animations, but exporting them (or creating them) has proved difficult. We keep getting this error when we try to export:
There is a way to do this as other modders in the community have made models and animations, and I believe there is just a setting we are missing. Any help would be appreciated!
Thank you.
Mesh import failed!
'NoneType' object has no attribute 'inputs'
Traceback (most recent call last):
File "C:\Users\86130\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_pdx_mesh\pdx_blender\blender_ui.py", line 387, in execute
bonespace=self.chk_bonespace
File "C:\Users\86130\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_pdx_mesh\pdx_blender\blender_import_export.py", line 1122, in import_meshfile
create_material(pdx_material, mesh, os.path.split(meshpath)[0])
File "C:\Users\86130\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_pdx_mesh\pdx_blender\blender_import_export.py", line 671, in create_material
shader = create_shader(PDX_material, shader_name, texture_path)
File "C:\Users\86130\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_pdx_mesh\pdx_blender\blender_import_export.py", line 624, in create_shader
links.new(albedo_texture.outputs['Color'], shader_root.inputs['Base Color'])
AttributeError: 'NoneType' object has no attribute 'inputs'
location: :-1
When creating a new pdxmaterial in blender, it automatically creates unnamed empty images to place in the new material's image nodes.
I'd like to request a setting that just leaves said image nodes empty instead when creating a new material, instead of generating new blank images, which are kind of useless, especially to my workflow. The problem is by now in my main shipset file Ive ended up with several dozen empty images clogging up the file, and its becoming a hassle to unlink them.
Hi,
Haven't used blender for years, and wanted to check if I can tweak some broken mod meshes using this addon.
Immediately bumped into a couple issues enabling it and seemingly bogus/outdated info in the README.
Both issues are with completely default Blender 2.91, running with no initial settings dir.
Issue when trying to enable it - NotImplementedError: Running from unknown environment "/usr/bin/python3.9"
.
Not sure why it's not set to "blender" here (Arch Linux, Blender 2.91.2), but maybe instead of NotImplementedError, addon can try importing either of the top-level blender/maya modules and only raise that with ImportError on both?
Can be a local issue too, but wanted to report jic it might not be.
README - there's no such thing as "Tool Shelf".
Closest that "View" menu has is "Toolbar" and that's NOT where this addon should be found!
It's under "Sidebar", which indeed is not enabled in blender by default.
Same as above, not a habitual blender user, so maybe instructions in the README make more sense in some other presumably-more-common non-default/non-linux configuration of blender.
But if not, maybe README should be updated to at least point in the right direction, instead of kinda away from it :)
Thought to record a quick video of the install/first-use process here, to show it looks here, in case none of the above applies to some different testing setup that you're using: https://e.var.nz/2021-03-18.blender-io_pdx_mesh-quirks.mp4
Cheers!
While importing some animations i found that it takes around 30 seconds to import basic animation. Then i found todo comment in your code about it being so slow. Are you still planning to improve it?
save mesh does not appear to export skeleton when option is ticked. it only seems to work if export skeleton is the only option ticked. all other objects are exported as expected with default options ticked, except for the skeleton.
Greetings!
In the latest version 0.71 of the importer tools the export/import of locator objects fails. Whenever I parent a locator to a bone, export and re-import it, I get this error:
On top of this it also seems to not work in-game either as it is supposed to. Locators without bone linkage work just fine. It appears that this bug was introduced with the most recent build. To confirm this theory, I imported a mesh, which I exported with version 0.7, which it properly imported all locators as it should be. I have uploaded both working and failing meshes below for you to test as well:
I hope this issue can be resolved fast, since it busts bone linked locators for good right now ๐ .
Hi first of all: great tool and thank you for providing it!
So i am kinda new to blender and using this tool, so sorry if i missed something obvious but after installing your plugin i am able to open Stellaris PDX mesh files and rework them and save them successfully after opening Stellaris mesh files for the first time and then they are getting loaded correctly in game. so far so good.
but unfortunately when i try to open any of those previously via Blender + your plugin saved mesh files again with blender then the "rendering" does not work anymore (shows pink color) and when i ignore this and save them again then the 3D model looks black without any texturing in game. this is > not < only the case when i actually reworked/edited any Stellaris mesh file but also happens if i just did nothing apart from
the only workaround i found was that i had to recreate all work-steps again when i wanted to edit a mesh file that i previously worked on and saved for the first time but this is getting annoying and not reasonable for me since i want to be able to work on mesh files more than one time and save/reload the progress. so can anybody maybe tell me what i am doing wrong? or if this is a bug of the plugin?
PS: using Windows 10, Blender 2.92.0 and your most current plugin + Stellaris
Hey there, hopefully your still responding to people on here, been trying to get into eu4 modding and was attempting to install this for Blender. Everytime i add it to my Add-ons it comes up with this message when i attempt to check the box.
No idea how to fix this and it would be amazing if you could push me in the right direction. Thanks :)
I keep getting this issues when trying to export an animation.
`Animation export failed!
Operator bpy.ops.object.select_all.poll() failed, context is incorrect
Traceback (most recent call last):
File "C:\Users\XXX\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\io_pdx_mesh\pdx_blender\blender_ui.py", line 581, in execute
export_animfile(self.filepath, frame_start=context.scene.frame_start, frame_end=context.scene.frame_end)
File "C:\Users\XXX\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\io_pdx_mesh\pdx_blender\blender_import_export.py", line 1637, in export_animfile
bpy.ops.object.select_all(action="DESELECT")
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy\ops.py", line 201, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.select_all.poll() failed, context is incorrect
location: :-1`
I imported the model of CK3 eyes into Blender using this plugin, and changed the UV mapping to separate the eyes so each eye uses a different part of the texture. To do this, I doubled the width of the original texture from 512px to 1024px.
However, when I export the model, the extended part of the texture lacks any background, and I can't figure out why. In the image below, the white eye is correct, but the black eye should also be white.
I'm not sure if this is being caused by this plugin, and I apologise if it isn't!
WHY
First off, have almost no idea what I'm doing with this tool, took 3 hours to get it to even be able to export, and I don't even know if this is the texture. Anyway, the first file is the creation before exporting it as a .mesh file, and the second picture is the same creation after it has been exported and imported again. Any idea why it would change how it looks (and how to change it back if possible)?
Currently, when I import a .mesh file with textures, the textures get created, but the alpha channel of the textures do not get hooked up properly in the node graph. This results in the textures being improperly displayed (no transparency)
I have a mod with pdx mesh files that I am trying to open in blender. When I try to open them with the add on, I get this error:
Mesh import failed!
'NoneType' object is not iterable
Traceback (most recent call last):
File "C:\Users\carte\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_pdx_mesh\pdx_blender\blender_ui.py", line 387, in execute
bonespace=self.chk_bonespace
File "C:\Users\carte\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\io_pdx_mesh\pdx_blender\blender_import_export.py", line 1087, in import_meshfile
for i, node in enumerate(shapes):
TypeError: 'NoneType' object is not iterable
location: :-1
Is there a fix, or am I out of luck?
I'm trying to export a custom mesh and animation from Maya 2020 into the Stellaris PDX format. The exporter isn't detecting my animation or materials so it obviously fails to export. Help would be much appreciated!
After downloading the Add-on and selecting the Zip through preferences, I get an error when trying to enable with tracecallback not having a register attribute. Apologies if this is an error on my end, I am new to this process.
Maybe it's me, but I can't run it on the latest blender.
In blender, when making Stellaris ships, you currently have to make a separate blend file for EVERY individual section so as to avoid duplicate empty names, as well as the previously submitted issue where you cannot specify locators to export, as it will always export every locator in the file.
Assuming that was fixed, if the plugin could also remove the extra ".00#" added to the names of duplicates when exporting empties, it would handily solve locator name conflicts and thus allow the creation and export of multiple entities within the comfort of the same blender file instead of having to make several dozen(in the case of a Stellaris shipset)
Hi @ross-g, thanks for your amazing Maya plugin, I almost re designed whole Star Wars ship pack ๐
I encounter error on importing several existing mesh files designed by Elratie, seems somehow this designs have more than 7 bit ascii code values, albeit they show perfectly in game.
so I would suggest that maybe this is a problem of python ascii decoder and it might need some tweak to accept these unusual but valid data inputs.
I attach a mesh file with ascii import problem.
It seems like vertex ordering changes slightly when you export and import back in. The first vert (0) starts at the correct location but the numbering seems to follow different orders around each quad.
This makes custom blendshapes impossible as parts of the mesh (mostly noticable around UV seams and mesh edges) are offset due to the incorrect vert order.
It would be very very usaeful for Imperator and future games since a lot of portrait stuff relies on blendshapes such as clothing/beards, you are required to make blendshape versions of these meshes in order for them to fit onto characters with differing body/head shapes.
More info and pics are on the imperator modding coop gfx channel
Installed io_pdx_mesh in Blender 2.82
Usage instructions were inaccurate for ver. 2.82.
Attempted to import Paradox Stellaris animation file "humanoid_01_battleship_frame_death.anim"
Operation failed.
Received error messages:
"Automation import failed!"
""Missing unique armature required for animation: []
"Traceback (most recent call last):"
"File "C:\Users\Dav\AppData\Roaming\Blender
Foundation\Blender\2.82\scripts\addons\io_pdx_mesh\pdx_blender\blender_ui.py",
line 441, in execute timestart=self.int_start
File "C:\Users\Dav\AppData\Roaming\Blender
Foundation\Blender\2.82\scripts\addons\io_pdx_mesh\pdx_blender\blender_import_export.py", in import_aminfile raise Runtime Error("Missing unique armature required for animation: {0}".format(matching_rigs))
RuntimeError: Missing unique armature required for animation: []
Location: :-1
Comments: Blender version 2.82 has no "Tool Shelf". The io_pdx_mesh menu is displayed by pressing the 'N' key. .mesh files import just fine.
Very helpful plugin. Thanks for your good work.
Which blender version(s) are supported?
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.