elitepvpers

elitepvpers (https://www.elitepvpers.com/forum/)
-   Rappelz Private Server (https://www.elitepvpers.com/forum/rappelz-private-server/)
-   -   [Release] NX3 import/export plugin for blender (https://www.elitepvpers.com/forum/rappelz-private-server/2807001-release-nx3-import-export-plugin-blender.html)

glandu2 08/24/2013 17:58

[Release] NX3 import/export plugin for blender
 
3 Attachment(s)
BTRFdom plugin features

I release now a version which seems to be complete, here are the features supported by this plugin for this version:
  • Mesh using triangles as faces
  • Duplicate vertices handling
  • Materials and texture filename (you must manage your texture image yourself, it's not included in the nx3 file)
  • Texture UV coords
  • Bones transformations including rotation (dae was not supporting rotation...)
  • Meshes without armature with meshes with armatures (bones)
  • Import/export of file using multiple material ID and multiple textures per material ID

What is not supported at this time:
  • Skeletal animations (but the model and vertices location & weight related to bones can be modified as animation data is not in nx3 files but in a naf file)
  • Matrix based animations (even modifying it's static mesh is not possible as these animation is in the nx3 file)
  • Export of meshes/armature which origin is not (0,0,0)

So with this plugin, you can edit simple files, not big structure or some mobs. But if you encounter a file that an error different from these posted here, you can post it too so I will be able to manage them correctly in later versions

How to install it

So to install the plugin, use the same architecture as the blender arch, if you have Blender x86 you must use the x86 version of the plugin. (no matter if you're running a x86 or x64 version of windows). For Blender x64 use the x64 version of the plugin.

You can't mix x86 and x64, it will throw an error if you try that.

So to install it:
  • Copy the io_scene_btrf folder in x.xx/scripts/addons where x.xx is the version of blender and is in the same folder as blender.exe
  • Open blender
  • Go to menu: "File->User preferences"
  • Choose the tab "Addons" in the new opened window (with title: Blender User Preferences)
  • Search for "Rappelz NX3 Format"
  • tick the checkbox at the right of the line with "Import-Export: Rappelz NX3 Format"
  • Click on the "Save As Default" button at the bottom left of the window

How to open a nx3 file

To open a NX3 file:
  • Go to menu: "File->Import->Rappelz NX3 (.nx3)"
  • Select your nx3 file then click on the button "Import NX3"

To have textures in blender, the texture must be in the same folder as the NX3 file. And blender may have problem when rendering DDS textures in the realtime 3D view (but the real texture is correct. You can still choose to convert the texture to another format like png and change the texture filename extension using a hex editor the nx3 file)

So here an example of a exported custom mesh (which was created by Gr4ph0s):
[Only registered and activated users can see links. Click Here To Register...]

The same char but moving, the sword follow the hand (the sword is bound to the hand using a bone)
[Only registered and activated users can see links. Click Here To Register...]

I attached the binary dll with the plugin for blender, if one of the zip does not work, try the other one. You can also compile it using the [Only registered and activated users can see links. Click Here To Register...]

1handaxe_smallaxe.zip contains 1handaxe_smallaxe.nx3 & .dds which are the one rappelz read, and 1handaxe_smallaxe_tga.nx3 and tga which are the same files but using a tga texture which blender can correctly read.

To find out how to have a exportable mesh with bones, import an existing one to see the layout in the outliner.

Armature and bones

Basically, you should just have a mesh object in a armature object.
See more here: [Only registered and activated users can see links. Click Here To Register...]

Assign an object to an armature to have bones
Spoiler:
For that, drag the plane onto the polymsh armature:
[Only registered and activated users can see links. Click Here To Register...]

Then choose "With Empty Groups" to set no weight for bones (your plane will not move when bone will be moving):
[Only registered and activated users can see links. Click Here To Register...]

Then you should have this outline:
[Only registered and activated users can see links. Click Here To Register...]

And you can export your mesh.


Important notes

Textures

Textures must be available to rappelz by either injecting them in data.00x or putting it in resources folder with the name hashed. The texture format MUST be DDS. If blender does not handle well the DDS texture, you can convert it to another format like TGA or PNG, but remember to convert it back to DDS before exporting the final model. Rappelz won't accept other files than DDS, and will show the weapon untextured in that case.

Use triangles, not quads for faces
Before exporting to nx3, you must have only triangles.
You can do that by selecting your object, then go into Edit mode.
Then select all vertices (with A shortcut) and triangulates all faces (with CTRL + T shortcut or in the menu Mesh -> Faces -> Triangulates Faces)

Assign weight to all vertices

Select your weapon, go to weight mode.
click on "Vertex selection masking for painting" (3rd button on the right of the mode combobox with "Vertex Paint" in it, it a cube with a vertex at the upper left of the cube)

At the left panel (hide/unhide it with the T key), set the Weight to 1 (under "Multi-Paint")

Then select all vertex by pressing "A" key while having the mouse in the 3D view. Vertices should all be yellow. If vertices are already yellow, press 2 times A to be sure to select all of them, even hidden ones. Then press SHIFT + K (or go to menu "Weights -> Set Weights")

This will set all vertex weight to 1 even hidden ones.

Incorrect position in-game (like weapon not in hands of the char), or how to set the origin of an object properly

You must set the origin to 0 for bones to work properly. You can do that by selecting your weapon (in object mode), then press CTRL + A while having the mouse in the 3D view. Then select Location. Do the same for Scale and Rotation.

Updates

Updated files are on github: [Only registered and activated users can see links. Click Here To Register...]
You can download import_btrf.py and export_btrf.py and replace the old one. This will update scripts.

I bumped the version to 1.2 and the new zip files contain up to date plugin. The DLL and tml files are moved to the directory where .py files are.

The 1.3 version allow to import more files, files that contain several meshes are supported (like betrayal) and texture/materials are correctly mapped. It use now blender 2.68 (else you will have not well mapped textures). Export of multiple objects is supported (even if not all have bones).

For any bug report, please go here: [Only registered and activated users can see links. Click Here To Register...]
This way, anyone will be able to see if it's bug was already corrected or is already noticed there.
If you don't want a github account, then post here

DeMeTR 08/24/2013 18:16

nice man ... you the best

gr4ph0s 08/24/2013 18:46

My dagger become an axe/sword... Sad story :'(

XD as I say you gg and thanks :)

DeMeTR 08/24/2013 19:19

why when always I want to export tell me error

darkm125 08/24/2013 19:23

gr4ph0s Nice job :o and thanks for sharing.

TheOnlyOneRaskim 08/24/2013 19:49

I think this is the first time im writing this but, awesome. And thanks alot for this Release. ;)

glandu2 08/24/2013 20:19

Quote:

Originally Posted by TheOnlyOneRaskim (Post 24592783)
I think this is the first time im writing this but, awesome. And thanks alot for this Release. ;)

xD, well, if this rare, then thanks x) Btw thanks all, maybe someone will create a R8 full stuff :o
We discused shortly about that with Gr4ph0s, and encountered some not bad models like these:
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Unfortunatly, the later which is a summoned bow in skyrim cannot be rendered in Rappelz as this bow use special effects than Rappelz seems to not support (or at least, my plugin don't support effects at this time, but I am sure we can do something almost like this bow using effects like enhanced stuffs (+20 for example))

Some nx3 file have duplicate faces (oh well, thanks GALA to duplicate things even faces in meshes) and caused the importer to fail.

I fixed that there [Only registered and activated users can see links. Click Here To Register...]
You can download the fixed import_btrf.py file here: [Only registered and activated users can see links. Click Here To Register...]
(right click on this link then download target or so else your browser will probably open this file as text)

Just replace the import_btrf.py file you have in io_scene_btrf folder with this one and restart any Blender instance using the btrf plugin.

XavierDeFawks 08/24/2013 20:28

1 Attachment(s)
When i import the betrayal model i get mostly bones with like 1 peice of armor. :x

glandu2 08/24/2013 20:34

the model is probably split, for asf_body_deco_roma.nx3 it's the case, body, hands, head, feet have different nx3 files.

The models are then connected using bones, and a NAF file probably describe animations using these bone.

So a model that use animation can be modified, but the bones must keep the same meaning as before (as they will be animated). The way bones are rotated/located in blender might not be the actual in-game position (the animation might define completely unrelated positions).

Betrayal cannot be changed to a non-human like model because of it's bones (or you must do tricks to behave as you want...)

XavierDeFawks 08/24/2013 20:36

Quote:

Originally Posted by glandu2 (Post 24593691)
the model is probably splited, for asf_body_deco_roma.nx3 it's the case, body, hands, head, feet have different nx3 files.

Makes sense except that when i convert to dae it shows the whole model just textures r messed up :x

glandu2 08/24/2013 20:56

Your image is too small to read something, but there is nothing but the bones in your screenshot ?

darkm125 08/24/2013 20:58

glandu for me not work my weapon and gray and no modify.

XavierDeFawks 08/24/2013 21:07

Quote:

Originally Posted by glandu2 (Post 24594104)
Your image is too small to read something, but there is nothing but the bones in your screenshot ?

Give me a minute and i will take larger screenshots of both import and dae.

Edit:

Imported
[Only registered and activated users can see links. Click Here To Register...]

DAE Convert
[Only registered and activated users can see links. Click Here To Register...]

glandu2 08/24/2013 21:24

Quote:

Originally Posted by darkm125 (Post 24594145)
glandu for me not work my weapon and gray and no modify.

It's the export which didn't work ?

In that case:

To export a weapon mesh you must prepare it before exporting:
  • When you have your mesh in blender, import an existing rappelz weapon (ideally the one you want to replace)
  • Then delete the rappelz's weapon mesh data (select it then press delete key while having the mouse in the 3d viewport)
  • Move your object on the armature (the root of the rappelz's mesh) to set it's parent
  • Select "Armature deform with empty groups"
  • Then select your object and enter weight paint mode
  • Select the vertex group of the bone to which you will associate vertices
  • Paint vertices which must be moved with the bone
  • Repeat for other vertex groups
  • Select your object, then press CTRL+A then click on Location, then repress CTRL+A and click on Rotation & Scale

I will try to improve this using image and update the original post with that as it's not trivial (especially true for ones who never used Blender before)

darkm125 08/24/2013 21:30

Thanks glandu i try it tomorrow

glandu2 08/24/2013 21:41

Quote:

Originally Posted by xXExiledXx (Post 24594297)
Give me a minute and i will take larger screenshots of both import and dae.

Edit:

Imported

DAE Convert

I found the problem. This nx3 file has several model inside and I don't support this feature.
Btw thanks for reporting this bug ^^

In fact Blender support having several objects which are a group of vertex. There it would be one model per part (helmet, head, body, hands, ...) but on some files (like butkadah), there is several "subobjects" and I wrongly used subobjets as object in blender. (as all objects use the same bones, bones are for the whole nx3 file)

For that, I must find a solution to support subobjects to be able to export them correctly


At this time the outline is:

Object_name as armature
Pose
Object_name as bones
bones names ...
Object_name_0 as object
Object_name_0 as mesh
Modifiers
Object_name as armature reference
Vertex Groups
bones names ...

With Object_name the name of the first object in the file.

I think I will use an empty object without any vertices for objects and put vertices in subobject, child of the object, but this require modification of both import and export scripts and I may not have the time to do that within this week-end :/

Modamer9 08/24/2013 21:48

this tools is great development from you Glandu2... but i have this error when i export a simple nx3.
but when i export *.dae it export good
[Only registered and activated users can see links. Click Here To Register...]

glandu2 08/24/2013 21:53

Are you sure you used a texture file for your mesh ? (it's important that's a file is used, Rappelz does not support texture generated by an algorithm)

If yes, can you upload your .blend file ? (Using File->save) So I can test it for the problem

The dae exporter is built-in in blender, so you are unlikely to find bugs in it ^^ I used the DAE format before as blender has a built-in DAE importer too, and DAE support all things supported by NX3, but now I don't use DAE anymore (using directly a plugin in blender is far easier to implement things)

Modamer9 08/24/2013 22:18

1 Attachment(s)
I just import file keberoslv3_body.nx3 and put the texture file beast_keberos_3lv.tga in some folder ... in blender I just add mesh_plan and to creat simple wings to pet keberos . and when I use export it say error.
her my .blend.

XavierDeFawks 08/24/2013 22:20

I got another error to report. When you try to import terrain related stuff it gives you the abort error.

glandu2 08/24/2013 23:20

Open the console before doing the action that cause the crash and copy/paste there the error, it should say something

Quote:

Originally Posted by Modamer9 (Post 24595551)
I just import file keberoslv3_body.nx3 and put the texture file beast_keberos_3lv.tga in some folder ... in blender I just add mesh_plan and to creat simple wings to pet keberos . and when I use export it say error.
her my .blend.

You must move your plane inside polymsh armature
to have it next to polymsh_0
Doing this will set the armature polymsh as the parent of your plane, and it will ask you about what to do for bones, choose "Armature deform with empty groups"

If you don't do that, it will not export object with bones (you can't mix object with bones and without bones)

For the error, you need to add a material and a textures to the plane.
(But I can make support for exporting meshes without material, but it will look ugly in-game and require some work as the material system in the exporter is not very well done)

XavierDeFawks 08/25/2013 04:42

This is what I get when I try to import the tent in the center of horizon.

[Only registered and activated users can see links. Click Here To Register...]

glandu2 08/25/2013 11:44

the version block does not exist for this file. Btw, this file seems to be one of the most complicated one using almost all feature NX3 have (it use mtl id and texture id, multiple object and multiple subobject inside objects, subobject transformation (which as I see works correctly), animations based on matrix transformations but does not have bones.

As for your other bug report, this file use the same feature along with others that are not supported. But this file is a good target goal as it has many feature and difference from other files

Stongx 08/25/2013 15:07

Thank you a lot for that its will help me a lot^^

Modamer9 08/25/2013 16:26

I love this tools very much :xd

[Only registered and activated users can see links. Click Here To Register...]

glandu2 I try to Import a 1handaxe_smallaxe.nx3 with not modification and try to export it .... but i get some error.

darkm125 08/25/2013 16:45

Glandu my news weapon work just my weapon is gray :(

Stongx 08/25/2013 17:53

Quote:

Originally Posted by darkm125 (Post 24608384)
Glandu my news weapon work just my weapon is gray :(

I think the problem it from the dds it not connect with the nx3 maybe there are a settings@@
and we waiting glandu@@

Modamer9 08/25/2013 19:11

if you have problem in texture ... you must read file name .nx3 with hex and see what name the dds write in it. and put the file in some folder file .nx3.
if blender does not read file dds ... u must convert it in .tga file.

XavierDeFawks 08/25/2013 19:44

Quote:

Originally Posted by Modamer9 (Post 24611691)
if you have problem in texture ... you must read file name .nx3 with hex and see what name the dds write in it. and put the file in some folder file .nx3.
if blender does not read file dds ... u must convert it in .tga file.

It's not that blender doesn't read dds files it just doesn't map it correctly to the model.

glandu2 08/25/2013 19:46

Quote:

Originally Posted by darkm125 (Post 24608384)
Glandu my news weapon work just my weapon is gray :(

Your weapon is gray in-game ? Are you sure you have also put your texture in Rappelz too ?

Quote:

Originally Posted by Modamer9 (Post 24607950)
I love this tools very much :xd


glandu2 I try to Import a 1handaxe_smallaxe.nx3 with not modification and try to export it .... but i get some error.

What's your error ? If the error cause Blender to quit/crash, activate the console with the menu "Window->toggle system console" then do the action that cause the error and then copy/paste here the content of the console.

Else if it does not cause Blender to quit, use a screenshot and post it here

darkm125 08/25/2013 19:54

Quote:

Originally Posted by glandu2 (Post 24612607)
Your weapon is gray in-game ? Are you sure you have also put your texture in Rappelz too ?

Yes i have add texture on blender and resource folder

glandu2 08/25/2013 19:55

Quote:

Originally Posted by darkm125 (Post 24612800)
Yes i have add texture on blender and resource folder

Can you post you .blend file and the exported nx3 and it's texture here so I can see what's wrong ?

darkm125 08/25/2013 20:05

Quote:

Originally Posted by glandu2 (Post 24612828)
Can you post you .blend file and the exported nx3 and it's texture here so I can see what's wrong ?

Ok upload it tomorrow i am not on my computer

Modamer9 08/25/2013 21:15

Quote:

Originally Posted by glandu2 (Post 24612607)

What's your error ? If the error cause Blender to quit/crash, activate the console with the menu "Window->toggle system console" then do the action that cause the error and then copy/paste here the content of the console.

Else if it does not cause Blender to quit, use a screenshot and post it here

the blender does not crash or quit ... just error when i use export to *.nx3 ... I try all what u said but always give me block error in 2 file _init_.py & export_btrf.py

[Only registered and activated users can see links. Click Here To Register...]

Dark.Gts 08/25/2013 21:21

Amazing work, Glandu, thank you so much!

I don't know if this is a problem on my part, but every single time I import an nx3, replace the model, then export straight away, the texures won't show up in game.
However, saving the scene in blender and loading it again right before exporting seems to magically fix the problem.

On a different note, Glandu, would it be possible to get textures to repeat mirrored instead of tiled? (the option in Textures/Image Mapping, Mirror: X and Y checked)

glandu2 08/25/2013 22:40

Quote:

Originally Posted by Modamer9 (Post 24614704)
the blender does not crash or quit ... just error when i use export to *.nx3 ... I try all what u said but always give me block error in 2 file _init_.py & export_btrf.py

[Only registered and activated users can see links. Click Here To Register...]

It means that you don't have a texture on your mesh.

But anyway, here is the fixed file for exporting mesh without textures:
[Only registered and activated users can see links. Click Here To Register...]

But keep in mind that if your model file is the same as in test.rar you gave, it will only export the monster, not your plane, as you can't export object without bones along with object with bones.

You mush set the armature (polymsh) as the parent.

For that, drag the plane onto the polymsh armature:
[Only registered and activated users can see links. Click Here To Register...]

Then choose "With Empty Groups" to set no weight for bones (your plane will not move when bone will be moving):
[Only registered and activated users can see links. Click Here To Register...]

Then you should have this outline:
[Only registered and activated users can see links. Click Here To Register...]

And you can export your mesh.

If your plane is not correctly exported, try to combine your plane with polymsh object:
Select your plane, THEN select the polymsh_0 while pressing shift (to select both objects, the order plane then polymsh is important)
Then press CTRL+J and your are done.

Quote:

Originally Posted by Dark.Gts (Post 24614868)
Amazing work, Glandu, thank you so much!

I don't know if this is a problem on my part, but every single time I import an nx3, replace the model, then export straight away, the texures won't show up in game.
However, saving the scene in blender and loading it again right before exporting seems to magically fix the problem.

On a different note, Glandu, would it be possible to get textures to repeat mirrored instead of tiled? (the option in Textures/Image Mapping, Mirror: X and Y checked)

Probably a problem with existing texture but not used, this problem has showed before for texture too. Seems not fully fixed then.

For texture, UV need to be between 0 and 1, so texture repetition is not possible. I might test that further later, but for now, repeat the texture manually and use the repeated texture for example, this feature is not a priority, before that having the possibility to import all possible nx3 files.

For the exporter, there are also many cases that I have to handle, like a mesh without bones with another mesh which have bones (in nx3 files, the bones are for the whole file and all meshes must reference it it seems)

virus1998 08/26/2013 03:18

Wow I have problemes
1-when import :
[Only registered and activated users can see links. Click Here To Register...]
2-when Export :
[Only registered and activated users can see links. Click Here To Register...]

I hope you help me bro

glandu2 08/26/2013 14:11

Quote:

Originally Posted by virus1998 (Post 24619884)
Wow I have problemes
1-when import :
[Only registered and activated users can see links. Click Here To Register...]
2-when Export :
[Only registered and activated users can see links. Click Here To Register...]

I hope you help me bro

Are you sure you have the correct BTRFdom.dll in the blender directory (where blender.exe is) ? You must choose x86 or x64 according to your blender installation.
As I can see, you didn't have blender in Program files(x86) so use the same DLL as your system architecture.

As said before, the first error is not a problem, it does not prevent the plugin from working correctly. (I have this error too, it's related to msvc runtime dlls, manifests and winsxs, maybe because blender use it's own shipped version of msvcrXX.dll)

virus1998 08/26/2013 15:42

thank you glandu

but I Put the DLL file in Blender.exe Folder
[Only registered and activated users can see links. Click Here To Register...]

And the same Prolem

glandu2 08/26/2013 17:33

Are you sure you used the x86 version of the DLL ? If yes, use process monitor to see where blender try to load the DLL.
Also, try with blender version 2.64, it's the version I use to make the plugin (but I didn't noticed errors with blender 2.67, so that should not be the problem)


All times are GMT +1. The time now is 06:20.

Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.