johnzero7 / xnalaramesh Goto Github PK
View Code? Open in Web Editor NEWBlender addon Import/Export XPS Models, Poses
Blender addon Import/Export XPS Models, Poses
Hey guys,
I'm just trying to import some .mesh files with the plugin on 2.8, but nothing works. Using latest version (I think) of XNALaraMesh.
Here's the error log: (I've expunged my name, obviously)
"Importing file: C:\Users\Name\Downloads\FrankModels\generic_item.mesh
rootDir: C:\Users\Name\Downloads\FrankModels
File: C:\Users\Name\Downloads\FrankModels\generic_item.mesh
Reading Header
Header Found
Reading Bones
Read 109 Bones
Reading Meshes
Read 6 Meshes
Importing Armature 109 bones
Traceback (most recent call last):
File "C:\Users\Name\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\XNALaraMesh-master\xps_tools.py", line 138, in execute
status = import_xnalara_model.getInputFilename(xpsSettings)
File "C:\Users\Name\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 85, in getInputFilename
status = xpsImport()
File "C:\Users\Name\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 156, in xpsImport
armature_ob = createArmature(xpsSettings.autoIk)
File "C:\Users\Name\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 328, in createArmature
armature_ob.data.use_auto_ik = autoIk
AttributeError: 'Armature' object has no attribute 'use_auto_ik'
location: :-1"
Is this something a new XNALara patch will fix, or am I screwed? Is there any solution at all? Help much appreciated. Thanks guys.
Now that the beta has been released, it would be nice to support it!
All of the legacy materials stuff has been deleted in 2.8, so this might require larger changes...
What the reason of inverting the normal map? it well literally inverting the normal vector which causing weird shading in eevee
and here's the result if i bypass the invert node
as you can see bypassing the invert normal node giving me correct normal direction.
I'm just wondering why the normal have to be inverted from the start.
Not sure if this is a mistake.
Isn't the Specular texture supposed to connect to the Specular Input of the Principled Shader Node?
I've seen this happen with most XPS models.
Let me know if you need more examples.
XPS Model: https://www.deviantart.com/chrissy-tee/art/SCVI-Xianghua-XPS-Model-771201341
Hi!
I'm receiving the following error after I installed the addon:
addon_utils.disable: XNALaraMesh not disabled
Modules Installed (XNALaraMesh) from 'C:\Users\marce\Downloads\XNALaraMesh.1.8.5.zip' into 'C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons'
Traceback (most recent call last):
File "C:\Program Files (x86)\blender-2.79.0-git.2adf4b401ed2-windows64\2.79\scripts\modules\addon_utils.py", line 351, in enable
mod = import(module_name)
File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh_init_.py", line 54, in
import(name=name, fromlist=_modules)
File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\import_obj.py", line 44, in
from progress_report import ProgressReport, ProgressReportSubstep
ModuleNotFoundError: No module named 'progress_report'
This happens to 1.8.4 to 1.8.7
Any help is appreciated!
Thanks
we need multiple ascii file import and we need to be the mesh inside blender have the same file name, for example if i import ASCII file with name ( car_hood.ascii ) i will get inside blender the name ( submesh_0.007 ) so we need the mesh inside blender to be the same file name please.
EDIT: and can you please add an option for scaling the object with import, because some objects have a very small scale and when i try to import them to blender with that small scale the mesh messed up.
Hello, thank you for making this great addon. I'm still fairly new to Blender so it's possible I may have overlooked something.
I'm using Blender 2.78.5 Hash: f9963f2 on Windows 7 64bit
In Blender Cycles, after importing XPS models to Blender, and converting materials to Cycles, the transparent textures become white in the Material Viewport Shading and sometimes in the Rendered Viewport Shading.
Rendered Viewport Shading: https://i.imgur.com/ix4sgHY.jpg
Material Viewport Shading: https://i.imgur.com/0hb1uEi.jpg
Here is a recent XPS model I've tested: https://xcrofty.deviantart.com/art/The-King-of-Fighters-XIV-Mai-678059999
Also, I wasn't sure if I should make this a separate topic, but will XPStools incorporate Blender's new Principled Shader in the future?
Thank you for taking the time to read this, and thanks again for making this addon.
Hello, I looked through Issues and saw that naming imported objects after their respective files is not a desired way by the developer. But it still can be quite tedious to rename every object when working with a lot of files.
So I wanna propose a compromise, so to speak. Instead of renaming objects, which can be problematic as per the developer, the add-on should name the collection it creates after the file that was imported.
I hope this solution is compelling enough as it would've helped me A LOT.
P.S. To be clear this is a feature request, since I'm not a coder/developer. Thanks!
For some specific material (emmissive reflection upon standard material), the cycles converter creates some wrong links between the shaders:
(complete node setup: http://pasteall.org/pic/show.php?id=117798)
The normalmap gets completely ignored. If rewired to the following layout, the material looks good (and works :)
(complete node setup: http://pasteall.org/pic/show.php?id=117799)
Keep up the good work!
Sorry for reopening this issue. (I don't know if this is the correct way to reopen)
Do you mind taking a look at these 2 XPS models?
https://grummel83.deviantart.com/art/Jack-Combi-Suit-XPS-696968363
https://xxkammyxx.deviantart.com/art/Isabella-Valentine-Default-Soul-Calibur-IV-476050511
'Connect Bones' option in v1.8.0 appears to be working correctly with some of the previous models I've tested.
However, I just came across that Jack and Isabella XPS models, and it appears to ignore the 'Connect Bones'/'Connect All' options. It might be some sort of mistake the authors made with the armature, but I'm not sure.
If it helps you in anyway, I will try looking for other XPS models that might misbehave the same way.
Blender 2.79
Also, thank you for recent update. It makes the workflow much faster. Greatly appreciated.
Attempting to enable the addon produces this error:
https://gyazo.com/6dae1abaa9c3fc9b71798915fc061718
Using Blender version 2.79
Blender 2.79b 64bit
After importing a XPS model, converting materials to Cycles, and then switching Viewport Shading to Rendered, Blender crashes to desktop.
This happened with only 1 model:
I am trying to understand the point of an expression like
version_mayor <= 1 and version_minor <= 12
Which of these (
major,
minor)
is supposed to be “old” and which is “new”?
(0, 13)
(1, 12)
(1, 13)
Perhaps the check should be
(version_mayor, version_minor) <= (1, 12)
The option to 'Connect Bones' in the XPS import menu doesn't appear to do anything.
I think I started using XPS Tools last year and I don't remember seeing bones connect to each other after toggling that option.
Haven't seen any errors popup in the console.
Blender 2.78C and 2.79.
hi,
I'm Brendon, I help out with Blender addons & would like to ask you about your materials converter.
I've been testing out your materials converter & import & really like it. your conversion works quite well on many other formats also. I would be interested in replacing the current materials converter in Blender addons_contrib with something very similar to yours. Would you be interested in developing this area more? Are you able to separate the materials conversion out into it's own folder?
My concept script is here: https://github.com/meta-androcto/blenderpython/tree/master/scripts/addons_extern/AF_materials_specials
In this I'm updating the materials utils addon in blender & have made an initial switch & added a few things. I would like to submit this to Blender soonish & would prefer not to leave out the conversion. (current addons_contrib version would not make it.)
Thanks. Let me know what you think & keep up the good work. Your importer works better than most in blender also. :)
Most of the bipedal XPS models that I've used in Blender have the following bone naming format:
leg left toes
leg left ankle
leg left knee
leg left thigh
leg left thigh twist
arm left shoulder 1
arm left shoulder 2
arm left shoulder twist
arm left elbow
arm left wrist
arm left finger 1a
arm left finger 1b
arm left finger 1c
Blender has support for mirroring bone values, if the bone names are same and using the following suffixes:
bone.L bone.R
bone_L bone_R
bone_Left bone_Right
Ex:
Not only does this make bone editing easier, but it also makes mirroring pose values easier.
Can you add an option that will rename all the Left/Right bones to use the suggested suffixes above?
I don't know if this suggestion is possible. Maybe this is something only the XPS model creator can do?
Some XPS models are imported with an A-pose by default.
Setting up an IK rig can be a little difficult for a character with an A-pose.
It would be convenient if both feet are flat on the ground, which should make bone rotation/pole targets a bit more predictable.
Model with A-pose (You tested this 1 before): https://xcrofty.deviantart.com/art/The-King-of-Fighters-XIV-Mai-678059999
Model with T-pose (Almost T-pose/Feet flat on ground): https://lezisell.deviantart.com/art/Batman-Arkham-Knight-Catwoman-90s-XPS-ONLY-719615216
If you need more information, let me know.
Good job, congratulations.
One small problem I ran into was that on Linux the texture filenames are not imported correctly (presumably also on mac). I did some small changes on the read_xxx_xps.py files, so they always use ntpath.basename. This should work since XNALara is for windows only. maybe some equivalent correction should be made to the exporter, but for a quick hack I am done. Importing of XNALara files on my Linux box now works like a charm. Thank you for this excellent work.
I would like to send you this modification, so you can made the appropriate changes if you wish (maybe a high grade importer could be included in the official blender release).
Sadly the diff code is not printed correctly. basically I did:
On both read_ascii_xps.py and read_bin_xps.py
Add a import ntpath
On read_ascii_xps.py
Change line
textureFile = os.path.basename(ascii_ops.readString(file))
to
textureFile = ntpath.basename(ascii_ops.readString(file))
On read_bin_xps.py
Change line
textureFile = os.path.basename(readFilesString(file))
to
textureFile = ntpath.basename(readFilesString(file))
The bin_ops.roundToMultiple
routine can be shortened as follows:
diff --git a/bin_ops.py b/bin_ops.py
index b8109ee..fc3d1cc 100644
--- a/bin_ops.py
+++ b/bin_ops.py
@@ -21,10 +21,7 @@ class TypeFormat:
def roundToMultiple(numToRound, multiple):
- remainder = numToRound % multiple
- if (remainder == 0):
- return numToRound
- return numToRound + multiple - remainder
+ return (numToRound + multiple - 1) // multiple * multiple
Actually, given that it is only used to round to multiples of xps_const.ROUND_MULTIPLE
, which is 4, it could be simplified even further.
I gather the 2.79 branch is still supposed to be compatible with Blender 2.79.x. It isn’t quite, since you seem to have included a change specific to Blender 2.8. The following patch fixes this:
diff --git a/export_obj.py b/export_obj.py
index c07dd35..756865f 100644
--- a/export_obj.py
+++ b/export_obj.py
@@ -27,7 +27,7 @@ import mathutils
import operator
import bpy_extras.io_utils
-from progress_report import ProgressReport, ProgressReportSubstep
+from bpy_extras.wm_utils.progress_report import ProgressReport, ProgressReportSubstep
def name_compat(name):
diff --git a/import_obj.py b/import_obj.py
index 0d20772..2c75a58 100644
--- a/import_obj.py
+++ b/import_obj.py
@@ -41,7 +41,7 @@ import mathutils
from bpy_extras.io_utils import unpack_list
from bpy_extras.image_utils import load_image
-from progress_report import ProgressReport, ProgressReportSubstep
+from bpy_extras.wm_utils.progress_report import ProgressReport, ProgressReportSubstep
def line_value(line_split):
Note this is only meant for your 2.79 branch.
If I import an XPS model into blender 2.8, then immediately export to OBJ, the new obj file looses all its textures
Also, if I import an XPS model into 2.8, then export to XPS, the new XPS file also has no textures
The 2.7x version seems to work properly, think it is a 2.8 specific issue.
Hey, this was something I overlooked when I posted a similar feature request awhile back.
For common 3D formats (OBJ, DAE, FBX, etc.), by default, they appear to import into the active or last selected collection in the Blender Outliner, which can be useful during large projects with multiple collections within each other.
Is it possible to add an option in the import menu to import the XPS model or XPS model collection into the active collection?
Not sure what should be the default behavior, but I'm just throwing some ideas.
Currently, XPS Tools will not import poses for the bones that have been renamed via the 'XPS to Blender' option.
If you can add support for the renamed bones, that would be great.
Examples:
'arm left shoulder 1' --> 'arm side shoulder 1.L'
'arm left shoulder 2' --> 'arm side shoulder 2.L'
'arm left elbow' --> 'arm side elbow.L'
'arm left wrist' --> 'arm side wrist.L
'leg left thigh' --> 'leg side thigh.L'
'leg left knee' --> 'leg side knee.L'
'leg left ankle' --> 'leg side ankle.L'
'leg left toes' --> 'leg side toes.L'
etc...
Attempting to use this addon in the latest build of Blender v2.8 results in the following error:
------------------------------------------------------------
---------------EXECUTING XPS PYTHON IMPORTER----------------
------------------------------------------------------------
Importing file: [REDACTED]
File: [REDACTED]
Reading Header
Header Found
Reading Bones
Read 347 Bones
Reading Meshes
Read 39 Meshes
Importing Armature 347 bones
---*** Importing Mesh 24_base1_0.6_1_1 ***---
UV Layer Count: 1
Texture Count: 4
Created Mesh: 24_base1_0.6_1_1
New Mesh = 24_base1_0.6_1_1
Traceback (most recent call last):
File "[REDACTED]\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\XNALaraMesh\xps_tools.py", line 144, in execute
status = import_xnalara_model.getInputFilename(xpsSettings)
File "[REDACTED]\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 85, in getInputFilename
status = xpsImport()
File "[REDACTED]\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 150, in xpsImport
meshes_obs = importMeshesList(armature_ob)
File "[REDACTED]\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 466, in importMeshesList
for meshInfo in newMeshes]
File "[REDACTED]\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 466, in <listcomp>
for meshInfo in newMeshes]
File "[REDACTED]\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 611, in importMesh
makeBoneGroups(armature_ob, mesh_ob)
File "[REDACTED]\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 743, in makeBoneGroups
current_theme = C.user_preferences.themes.items()[0][0]
AttributeError: 'Context' object has no attribute 'user_preferences'
As can be inferred by the log, a single mesh imports before the addon aborts due to being unable to read some user preferences. I checked and found that for reasons unknown to me, the user preferences panel is indeed failing.
Any suggestions? This error occurs with the master as well, not only v1.9.0.
Blender 2.80 Beta 0fe5a789837 (Windows 64bit)
XPS Tools V1.9.0.
I came across this XPS model today and tested it with Blender 2.80 Beta:
The model appears correctly in Blender 2.79.
When I try importing this model: https://www.deviantart.com/jc-starstorm/art/Starship-Cockpit-592403166 I seem to end up with no objects created.
I got these black textures all the time (with many models)
https://img2.picload.org/image/wrwdgpg/materialerror.jpg
The meshes are seperat so we could maybe delete them or hide them on the conversation process
https://img5.picload.org/image/wrwdgwd/materialerror_2.jpg
Or at least dont use the normal for the diffuse shader since this is causing it to be black :/
https://picload.org/image/wrwdagw/materialerror3.jpg
Is there any way to remove them on conversation or something i can do to avoid them? It is very frustrating to remove them all the time :(
I hope oyu can help me and anyone else having this problem <3 You did a great job and let me know if I can help you fixing things :)
Couple of things:
hi, guys
i cant enable XPSTools v1.9.1 in blender 2.8 beta i got Keyerror
I came across this model that has a bunch of pose files:
https://www.deviantart.com/ysc976/art/KOFXIV-Yuri-break-cloth-774081742
All the pose files appear to make an animation sequence.
Do you have plans, in the future, to import multiple pose files as an animation?
Thanks
TODO cycles material converter
Per Blender's coding style: http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons#Coding_style
I can do it if you don't mind.
in converted materials you first have the mix shader with transparency, then add the emission
it would work better if you added the emission to the diffuse first and then applied the transparency to the result, so it also fades out the emissive parts as expected
Hey, happy holidays.
Unfortunately, I don't have an older 2.80 beta nightly build, so I will have to wait till the Blender devs finalize the API again.
In the meantime, I do have another feature request:
Ctrl+Alt+Z (Shows Undo History)
I don't know if this is a limitation, but Import XPS/Poses don't appear in the Undo History.
Blender 2.79b 64bit
XPS Tools 1.8.5
I don't know if the Blender developers unintentionally broke something or if they made some new adjustments that require addon developers to update their code.
Working: Blender 2.79 Official Release
Broken: Blender 2.79 Buildbot (Hash: 83ce028 Date: 2017-10-06 16:06)
XPS_Tools v1.7.3
Error when attempting to import an XPS model:
Traceback (most recent call last):
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\xps_tools.py", line 141, in execute
status = import_xnalara_model.getInputFilename(xpsSettings)
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 172, in getInputFilename
status = xpsImport()
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\timing.py", line 12, in wrap
ret = f(*args)
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 275, in xpsImport
meshes_obs = importMeshesList(armature_ob)
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 628, in importMeshesList
for meshInfo in newMeshes]
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 628, in
for meshInfo in newMeshes]
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 760, in importMesh
makeUvs(mesh_da, origFaces, uvLayers, vertColors)
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 558, in makeUvs
mesh_da.vertex_colors[0].data[loopdId].color = vertColors[faceVert]
ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 4 items, not 3
location: :-1
when i try to import the model (like i would with MMD or FBX) it wont show the X2M file like it would with mmd and fbx....
When converting materials to cycles, a color mix node without any functionality gets added inbetween each texture and the next node, which unnecessarily enlarges the node tree and also may slightly increase rendertime (if many materials get converted)...
[meaning the selected ones]
This may not be an issue but an intended functionality, but i see no other way than opening an issue to become clear about that.
Thanks for that great addon!
just a test
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.