我使用Microsoft的skinned model sample来加载我的Blender模型(.fbx)并播放他们的动画。导入SkinnedModelWindows和SkinnedModelPipeline项目,我添加了它们作为参考。但是当我想获取皮肤数据时(来自SkinnedModelPipeline),我收到了这个警告:
The referenced assembly "...\SkinnedModelPipeline.dll" could not be resolved because it has a dependency on "Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.
并且外观数据仍为空:
SkinningData skinningData = model.Tag as SkinningData;
if (skinningData == null)
throw new InvalidOperationException
("This model does not contain a SkinningData tag.");
从此我得到了例外。
想法如何解决?
非常感谢!
答案 0 :(得分:2)
听起来您的项目需要针对完整版.NET Framework而不是客户端配置文件构建。在Visual Studio的项目属性中,应该有一个选项,允许您在“应用程序”选项卡上更改目标框架。
答案 1 :(得分:1)
重新检查样本并查看哪个项目引用了哪个:
SkinnedModelWindows
SkinnedModelPipeline
SkinnedModelPipeline
引用SkinnedModelWindows
所有项目只需要定位.NET 4.0客户端配置文件,除以外的SkinnedModelPipeline
,这需要完整的框架(因为用于构建内容的内容管道程序集需要它)。 / p>