~360 Homebrew: XNA Game Studio Express

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
Post Reply
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Post by teamonkey »

Does anyone use Blender to make models for an XNA project? I'm having a few problems exporting: I export the file to .fbx but the model appears untextured. Either I'm only exporting the mesh and not the textures or the textures aren't being processed by the content pipeline properly. Any ideas?
User avatar
PaulCunningham
Baaaaa!
Baaaaa!
Posts: 1218
Joined: Sun Jan 18, 2004 11:47 pm 0
Location: Walsall, England
Contact:

Post by PaulCunningham »

I've not used Blender or models but you could try checking the Content Importer and Content Processor properties of the model file from within Visual Studio to see if anything looks a bit suss.
Cheers,
Paul Cunningham
Pumpkin Games
User avatar
Mark
Baaaaaa!
Baaaaaa!
Posts: 3611
Joined: Mon Apr 22, 2002 7:53 pm 0
Location: England

Post by Mark »

teamonkey wrote:Does anyone use Blender to make models for an XNA project? I'm having a few problems exporting: I export the file to .fbx but the model appears untextured. Either I'm only exporting the mesh and not the textures or the textures aren't being processed by the content pipeline properly. Any ideas?
I use Max rather than Blender but had the same problem.

The thing that fixed it for me was using the correct directory structure. The fbx file format stores a relative position of the texture file associated with the location of the model upon export. You need the same setup within your project file so that the texture can be found. You don't need to add the textures to your project though, they just need to be in the right place in the directory structure.

If you open your fbx up in notepad and do a search for "relative" you should find something like this: "RelativeFilename$ ..\Textures\tex01.bmp".

That's the relative location your project expects your model's texture to be. If in the example above the model was exported to "C:\models", the texture would have been in "C:\Textures". You need the same structure in your project. If you add the model to the project in a directory called, for example, "C:\blah\blah\blah\Content\Models" then you'll need to put the texture in "C:\blah\blah\blah\Content\textures".
User avatar
PaulCunningham
Baaaaa!
Baaaaa!
Posts: 1218
Joined: Sun Jan 18, 2004 11:47 pm 0
Location: Walsall, England
Contact:

Post by PaulCunningham »

Found this in the help file...

ms-help://MS.VSExpressCC.v80/MS.VSIPCC.v80/MS.XNAFX.1033/XNA/GoingBeyond_ContentPipeline.htm
Now you need two pieces of art. The first is the 3D model that will go into this new Content\Models folder, and the second is a texture that will be drawn on the 3D model; this will go in the Content\Textures folder. The files you need are back in the path you placed the Spacewar project in. To get them:

Right-click the Models folder in the Solution Explorer, click Add, and then click Existing Item. Using the dialog box that appears, browse back to the path you placed the Spacewar project in, and find the Contents\Models folder. Select p1_wedge.fbx. If you can't see any files, make sure you change the Files of type selection box to read Content Pipeline Files. Click OK.
Now, copy the textures associated with the model into the Textures folder. To do this, open a Windows Explorer window and browse to the Spacewar project path, and the Content\Textures folder. Copy wedge_p1_diff_v1.tga, and then browse to your project folder, then into the Content\Textures folder, and paste in the .tga you just copied.

Note that you don't see the texture you added in Solution Explorer. When you add a model, the textures that the model uses do not need to be added to the Content Pipeline. If you need to add textures that you will access manually (such as textures used for 2D sprite drawing), do so via Solution Explorer. Otherwise, you can simply copy the texture files to the appropriate folder.

When the files are added to the project, the Content Pipeline automatically identifies them as content files and sets the appropriate processors to run when you build your project. This will happen silently; you won't need to do anything. If you'd like to learn more about the Content Pipeline, see Content Pipeline.

Cheers,
Paul Cunningham
Pumpkin Games
User avatar
Oaf
Baaaaa!
Baaaaa!
Posts: 1688
Joined: Mon Nov 11, 2002 1:14 pm 0
Location: Dark Hedges
Contact:

Post by Oaf »

I think it depends which exporter you're using, too. The 3DSMax one I use stores complete path names in the fbx, which I have to search-and-replace with relative ones.
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Post by teamonkey »

What a pain. Why doesn't the content pipeline support a model format that bundles it all together? Come to think of it, I thought that the point of the content pipeline was so that you didn't have to export at all.

Grumble grumble...
User avatar
Oaf
Baaaaa!
Baaaaa!
Posts: 1688
Joined: Mon Nov 11, 2002 1:14 pm 0
Location: Dark Hedges
Contact:

Post by Oaf »

I think it's all getting sorted in XNA 2, which is going to be announced next week I think. Some sort of collaboration with XSI or something.
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Post by teamonkey »

Buggeration. It's not exporting any of the texture data at all and an old post on the XNA board suggests that I might have rigged the UV mapping wrongly. I might try Milkshape instead and see if it's worth the $25.
User avatar
sty
Baaaaaaa!
Baaaaaaa!
Posts: 6628
Joined: Thu Apr 25, 2002 2:03 pm 0
Location: Darfield, New Sheepland

Post by sty »

Oaf wrote:I think it's all getting sorted in XNA 2, which is going to be announced next week I think. Some sort of collaboration with XSI or something.
Just been to a session on XNA 10 minutes ago here at Tech-Ed in Australia and they never thought to mention anything about XNA2

I have to say the demo for XNA Express looked pretty easy, for some reason much clearer than last time I looked. May be worth a serious look soon I think, I just need to find the best way to get it up and running, last time I installed it on my laptop it choked to death the last time I needed to install a Visual Studio service pack since I had about 8 instances of VS to update
XBoxlive -> Mr Sty
User avatar
PaulCunningham
Baaaaa!
Baaaaa!
Posts: 1218
Joined: Sun Jan 18, 2004 11:47 pm 0
Location: Walsall, England
Contact:

Post by PaulCunningham »

I've got VS Pro but I develop my XNA stuff using C# Express. You can use VS proper as long as you don't need to change any Content Pipeline stuff (as that is only compatible with Express).

http://abi.exdream.com/ has a little app that allows you to easily switch between versions (so you can uses all your fancy addons in VS and then change to Express for content updates). Not used it myself though.

Here's an overview of what's happening in v2...
http://www.xnagamefest.com/talk_abstrac ... AME_STUDIO
Cheers,
Paul Cunningham
Pumpkin Games
User avatar
PaulCunningham
Baaaaa!
Baaaaa!
Posts: 1218
Joined: Sun Jan 18, 2004 11:47 pm 0
Location: Walsall, England
Contact:

Post by PaulCunningham »

Cheers,
Paul Cunningham
Pumpkin Games
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Post by teamonkey »

Anything good lads?
User avatar
PaulCunningham
Baaaaa!
Baaaaa!
Posts: 1218
Joined: Sun Jan 18, 2004 11:47 pm 0
Location: Walsall, England
Contact:

Post by PaulCunningham »

Missed the intro, 2.0 features, half of Torpex and the networking (I think we'll be able to use the LIVE service come 2.0). Sean's talk was pretty ace though. Some of the sessions are repeated today and they should be providing them on demand soon.

Does anybody now if they mentioned anything about distribution on the 360?

I was a little suprised with some of the Dream Build Play winners but it was great of them to offer 4 XBLA contracts.
Cheers,
Paul Cunningham
Pumpkin Games
User avatar
Oaf
Baaaaa!
Baaaaa!
Posts: 1688
Joined: Mon Nov 11, 2002 1:14 pm 0
Location: Dark Hedges
Contact:

Post by Oaf »

I think the biggest thing for me was they're going to sort out proper content importers, so hopefully when you import an object from 3DS or whatever, it'll work properly. Maybe ;)

Might have to get me a subscription now, as they're offering a "premium" starter kit today.

Oh, and the partnership with SoftImage was formally announced, so that too should solve some content importing problems.
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Post by teamonkey »

Post Reply