![Image](http://orig09.deviantart.net/952b/f/2017/148/0/f/1_by_lyutor1945-dbarts5.jpg)
![Image](http://orig07.deviantart.net/5e61/f/2017/148/a/4/2_by_lyutor1945-dbartry.jpg)
Also with the new version of the tool the UV coordinates of the models are upside down.
![Image](http://orig02.deviantart.net/fad2/f/2017/148/5/6/3_by_lyutor1945-dbaruxh.jpg)
lyutor1945 wrote:I found a bug in the model named hmf_head_cora_skinned_mesh. Wrong position of the jaw, small deformation, eyes and mesh lashes.
Finder wrote:Would anyone happen to know why I get an error when trying to open extracted .DDS textures?
I've tried both Paint.NET and Gimp without any luck
lyutor1945 wrote:I found a bug in the model named hmf_head_cora_skinned_mesh. Wrong position of the jaw, small deformation, eyes and mesh lashes.
lyutor1945 wrote:I waited:) Thanks to all of you for this tool. It is amazing. I continue to test mesh - plugins and don't see yet any big error. There are several small deformations on head models.
For example Cora's head model:
Decided to inform, just in case:)
P.S. I don't know for sure, these deformations due to the tool or should blame Bioware in laziness:)
lyutor1945 wrote:Also with the new version of the tool the UV coordinates of the models are upside down.
Code: Select all
how often do you want to ignore the answer I gave you, that you need to export with bones and this should be solved, by moving them. why do you think I spend the time to make a skeleton preview?
lyutor1945 wrote:Code: Select all
how often do you want to ignore the answer I gave you, that you need to export with bones and this should be solved, by moving them. why do you think I spend the time to make a skeleton preview?
I'm not ignoring your answers. Of course I extract the models with bones.The bug on the model with bones
spinal wrote:Hey guys,
Regarding the uv thing, I can take a look Voider.
I'll take a look at the cora model as well though at first glance, not sure I can find something...
Sowy...
warrantyvoider wrote:spinal wrote:Hey guys,
Regarding the uv thing, I can take a look Voider.
I'll take a look at the cora model as well though at first glance, not sure I can find something...[/quote
well the UV thing is easy to fix, just inverting the V coord, but im at work, so cant commit changes. with the deformation, I have no idea
greetz
Finder wrote:Sowy...
Btw, why to BMP? wouldn't it be better to convert textures like these to PNG?
spinal wrote:warrantyvoider wrote:spinal wrote:Hey guys,
Regarding the uv thing, I can take a look Voider.
I'll take a look at the cora model as well though at first glance, not sure I can find something...[/quote
well the UV thing is easy to fix, just inverting the V coord, but im at work, so cant commit changes. with the deformation, I have no idea
greetz
OK, so I'll just take a look at the Cora model then.
You honestly think that if I had any idea how these things work I would ask so many dumb questions hehewarrantyvoider wrote:Finder wrote:Sowy...
Btw, why to BMP? wouldn't it be better to convert textures like these to PNG?
its RGBA, each 8 bit, making it 32bit, which bmp aswell as png can store. but if you need png, its open source, just add it
spinal wrote:Hey WVoider,
Here is the FBXExporter project : FBXExporter.zip
If you want to compile, you will need to dowload the FBX SDK 2017 : http://usa.autodesk.com/adsk/servlet/pc ... d=26012646
In the zip, you have the project file FBXExporter.vcxproj : you need to modify all paths "G:\exe\FBX_SDK\2017.1" by the path where you will have installed the SDK.
I have compiled with the build tools v12 which are shipped with VS 2013 (which the version I have started the project with). You may need to upgrade the project depending the version you have.
Regarding integration with the plugins, there is an issue with the dependencies : as you will see, the FBXExporter class depends on MeshAsset, FBSkeleton, Vector and possibly FBBone which all are in Plugin System. But the exporter in pluginSystem also depends on FBXExporter, which means there is a cyclic dependency.
So I'm not sure how you want to proceed with this. To make it work, the exporters classes should either be moved back to the mesh plugin or maybe the asset classes could be in their own dll project. Or maybe, you will a better idea
I can take care of it if you wish and repost the whole project working. Just let me know.
Cheers!
warrantyvoider wrote:spinal wrote:Hey WVoider,
Here is the FBXExporter project : FBXExporter.zip
If you want to compile, you will need to dowload the FBX SDK 2017 : http://usa.autodesk.com/adsk/servlet/pc ... d=26012646
In the zip, you have the project file FBXExporter.vcxproj : you need to modify all paths "G:\exe\FBX_SDK\2017.1" by the path where you will have installed the SDK.
I have compiled with the build tools v12 which are shipped with VS 2013 (which the version I have started the project with). You may need to upgrade the project depending the version you have.
Regarding integration with the plugins, there is an issue with the dependencies : as you will see, the FBXExporter class depends on MeshAsset, FBSkeleton, Vector and possibly FBBone which all are in Plugin System. But the exporter in pluginSystem also depends on FBXExporter, which means there is a cyclic dependency.
So I'm not sure how you want to proceed with this. To make it work, the exporters classes should either be moved back to the mesh plugin or maybe the asset classes could be in their own dll project. Or maybe, you will a better idea
I can take care of it if you wish and repost the whole project working. Just let me know.
Cheers!
well I will look into it, then I can tell more![]()
UPDATE: so it took me a while to make a new FBX project from scratch, because stupid project settings like preprocessor flags, grrr... so i could test a few things and I see the problem, also how your code works. The solution is "simply" to move all the "convert to fbx format"-code to a c# class in pluginsystem, can be called FBXExporter as you suggested, and the actual functions to interact with fbx sdk (or better its lib) into the FBX CLR DLL (dunno how I gonna name it, FBXHelper I called my test project, but FBXExporter gets confusing if used many times on different things, namespace, class, later as variable name and another class in pluginsystem... nope, sry^^). So yeah, this could take a while (unless you want to do it) to convert the FBX dll into a wrapper dll for .Net, and then rewriting your code in C# in plugin system, but I'm on it^^ btw, that dll project will be seperate from the main project and all the plugin projects, because it needs the sdk as dependecy and I dont wanna upload 2x 80MB .lib files, so everyone could compile it. Instead I will give it an extra git repo, as I feel this will be reused again and ppl can download it + sdk and configure it themselfes
first I added an option to flip the texture coords before export, now it would be nice if someone can tell me if there is a default "flip" of the coords or if it varies among meshes, so has to stay as option...
now on github
greetz WV
Code: Select all
System.NullReferenceException: object Reference not set to an instance of an object.
in the PluginSystem.PSKExporter.ExportSkinnedMeshToPsk(FBSkeleton skeleton, MeshLOD LOD, Single OverrideScale)
in the PluginSystem.PSKExporter.ExportLod(MeshAsset mesh, lodIndex Int32, String targetFile)
in PluginMeshesWV.MainForm.toolStripButton5_Click(Object sender, EventArgs e)
in System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
in System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
in System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
in System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
in System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
in System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
in System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
in System.Windows.Forms.Control.WndProc(Message& m)
in System.Windows.Forms.ScrollableControl.WndProc(Message& m)
in System.Windows.Forms.ToolStrip.WndProc(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
lyutor1945 wrote:I was lucky as always, the model I was looking for all evening, is not exported to the PSK. MEA Tool shows this error.Code: Select all
System.NullReferenceException: object Reference not set to an instance of an object.
in the PluginSystem.PSKExporter.ExportSkinnedMeshToPsk(FBSkeleton skeleton, MeshLOD LOD, Single OverrideScale)
in the PluginSystem.PSKExporter.ExportLod(MeshAsset mesh, lodIndex Int32, String targetFile)
in PluginMeshesWV.MainForm.toolStripButton5_Click(Object sender, EventArgs e)
in System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
in System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
in System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
in System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
in System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
in System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
in System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
in System.Windows.Forms.Control.WndProc(Message& m)
in System.Windows.Forms.ScrollableControl.WndProc(Message& m)
in System.Windows.Forms.ToolStrip.WndProc(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Model named hmf_cas_ark_a_base_mesh
Code: Select all
A2778E73215DA6AA09697D26190C60102CE51226
-> D:\Program Files (x86)\Origin Games\Mass Effect Andromeda\Data\Win32\game\levels\bstory\turian\arknatanus\arknatanus.toc
-> win32/game/levels/bstory/turian/arknatanus/bstory_turian
-> game/characters/human/hmf/0_casual/ark/hmf_cas_ark_a_base/rendermesh/hmf_cas_ark_a_base_mesh
the mesh you selected seems to have no weights, so you need to repaint them...
Code: Select all
// FBXWrapper.h
#pragma once
#include "FBXUtils.h"
using namespace System;
namespace FBXWrapper {
public ref class FBXWrapper
{
public:
FBXUtils FbxUtils;
//more stuff here later on
};
public ref class FBXVector4
{
public:
property float X
{
float get()
{
return vector->mData[0];
};
void set(float f)
{
vector->mData[0] = f;
}
};
property float Y
{
float get()
{
return vector->mData[1];
};
void set(float f)
{
vector->mData[1] = f;
}
};
property float Z
{
float get()
{
return vector->mData[3];
};
void set(float f)
{
vector->mData[3] = f;
}
};
property float W
{
float get()
{
return vector->mData[3];
};
void set(float f)
{
vector->mData[3] = f;
}
};
FBXVector4();
FBXVector4(float x, float y, float z, float w);
FBXVector4(FbxVector4 v);
FbxVector4* vector;
};
public ref class FBXAMatrix
{
public:
FBXVector4^ getR();
void SetRow(int Y, FBXVector4^ row);
FBXAMatrix();
FbxAMatrix* mat;
};
}
Code: Select all
#include "stdafx.h"
#include "FBXWrapper.h"
#ifdef IOS_REF
#undef IOS_REF
#define IOS_REF (*(pManager->GetIOSettings()))
#endif
using namespace System::Runtime::InteropServices;
FBXWrapper::FBXVector4::FBXVector4(float x, float y, float z, float w)
{
vector = new FbxVector4(x, y, z, w);
}
FBXWrapper::FBXVector4::FBXVector4()
{
vector = new FbxVector4(0, 0, 0, 0);
}
FBXWrapper::FBXVector4::FBXVector4(FbxVector4 v)
{
vector = &v;
}
FBXWrapper::FBXAMatrix::FBXAMatrix()
{
mat = new FbxAMatrix();
}
FBXWrapper::FBXVector4^ FBXWrapper::FBXAMatrix::getR()
{
return gcnew FBXVector4(mat->GetR());
}
void FBXWrapper::FBXAMatrix::SetRow(int Y, FBXVector4^ row)
{
mat->SetRow(Y, *row->vector);
}
Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FBXWrapper;
namespace PluginSystem
{
public class FBXExporter
{
FBXVector4 CalculateBoneRotation(FBBone bone)
{
FBXAMatrix fbxrotMat = new FBXAMatrix();
FBXVector4 Forward = new FBXVector4(bone.Forward.members[0], bone.Forward.members[1], bone.Forward.members[2],0);
FBXVector4 Right= new FBXVector4(bone.Right.members[0], bone.Right.members[1], bone.Right.members[2],0);
FBXVector4 Up = new FBXVector4(bone.Up.members[0], bone.Up.members[1], bone.Up.members[2], 0);
fbxrotMat.SetRow(0, Right);
fbxrotMat.SetRow(1, Up);
fbxrotMat.SetRow(2, Forward);
fbxrotMat.SetRow(3, new FBXVector4(0, 0, 0, 1));
FBXVector4 boneRot = fbxrotMat.getR();
return boneRot;
}
}
}
Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FBXWrapper;
namespace PluginSystem
{
public class FBXExporter
{
public FBXVector4 CalculateBoneRotation(FBBone bone)
{
FBXAMatrix fbxrotMat = new FBXAMatrix();
FBXVector4 Forward = new FBXVector4(bone.Forward.members[0], bone.Forward.members[1], bone.Forward.members[2], 0);
FBXVector4 Right = new FBXVector4(bone.Right.members[0], bone.Right.members[1], bone.Right.members[2], 0);
FBXVector4 Up = new FBXVector4(bone.Up.members[0], bone.Up.members[1], bone.Up.members[2], 0);
fbxrotMat.SetRow(0, Right);
fbxrotMat.SetRow(1, Up);
fbxrotMat.SetRow(2, Forward);
fbxrotMat.SetRow(3, new FBXVector4(0, 0, 0, 1));
FBXVector4 boneRot = fbxrotMat.getR();
return boneRot;
}
public void UpdateSkeletonWithMorph(SkeletonAsset Skeleton, FBXNode pSkeletonNode, List<Vector> morphBones)
{
for (int i = 0; i < Skeleton.Bones.Count; i++)
{
FBBone fbbone = Skeleton.Bones[i];
FBXNode fbxBone = pSkeletonNode.FindChild(fbbone.Name);
Vector boneOffset = morphBones[i];
List<double> tmp = fbxBone.LclTranslation;
tmp[0] += boneOffset.members[0];
tmp[1] += boneOffset.members[1];
tmp[2] += boneOffset.members[2];
fbxBone.LclTranslation = tmp;
}
}
public void SetBoneTransform(FBBone bone, FBXNode fbxBoneNode)
{
List<double> tmp = new List<double>();
tmp.Add(bone.Location.members[0]);
tmp.Add(bone.Location.members[1]);
tmp.Add(bone.Location.members[2]);
fbxBoneNode.LclTranslation = tmp;
FBXVector4 rot = CalculateBoneRotation(bone);
tmp = new List<double>();
tmp.Add(rot.X);
tmp.Add(rot.Y);
tmp.Add(rot.Z);
fbxBoneNode.LclRotation = tmp;
}
}
}