Blender export - there has to be an easier way
by Richard Ranft · in Artist Corner · 03/11/2014 (8:45 am) · 23 replies
Seriously - I spent two days going in circles trying to export a model of Earth to COLLADA and get it into Torque 3D. TWO DAYS. Make a simple sphere. Add a material to it. Add a texture to that material. Export. Big gray ball.
So I ended up re-installing 3DS Max 7, exporting to .3DS, converting to FBX 2013 and then to COLLADA using Autodesk's conversion tool. Aside from some name length issues this works perfectly and the conversion tool can do batch conversions (hmm, wonder if I can script it....). Now I have Earth and Luna in T3D after a total of 40 minutes (25 of which was spent troubleshooting an issue with Luna's texture image).
What am I missing?
So I ended up re-installing 3DS Max 7, exporting to .3DS, converting to FBX 2013 and then to COLLADA using Autodesk's conversion tool. Aside from some name length issues this works perfectly and the conversion tool can do batch conversions (hmm, wonder if I can script it....). Now I have Earth and Luna in T3D after a total of 40 minutes (25 of which was spent troubleshooting an issue with Luna's texture image).
What am I missing?
About the author
I was a soldier, then a computer technician, an electrician, a technical writer, game programmer, and now software test/tools developer. I've been a hobbyist programmer since the age of 13.
#2
Do a search for openCollada for Max3D. I have been directly exporting EVERYTHING to Collada using that tool with no sub-steps or extra crap. If you have issues finding it I can upload the version I am using to my dropbox. Let me know. Either way, there are better solutions.
Ron
03/11/2014 (10:01 am)
Richard.... Can't help too much for Blender but, in MAX... Do a search for openCollada for Max3D. I have been directly exporting EVERYTHING to Collada using that tool with no sub-steps or extra crap. If you have issues finding it I can upload the version I am using to my dropbox. Let me know. Either way, there are better solutions.
Ron
#3
I did a search for openCollada for Max3D a while ago (maybe 2 years?) and didn't find a plug-in for Max 7. I haven't tested to see if any of the current plug-ins "just work" with it, though. I don't mind the extra steps, though - it went pretty quick once I figured out the flow. Like I said, maybe 20 min total for the sphere, the texture, export to .3DS, convert to FBX2013 and then to COLLADA - and that was because FBX has apparently changed since Max 7.... lol
@Dwarf - lol, no argument from me on that one. I'll give those videos a look - thanks!
03/11/2014 (2:56 pm)
I'm using Blender 2.65 or so - I'll verify this tonight when I get home.I did a search for openCollada for Max3D a while ago (maybe 2 years?) and didn't find a plug-in for Max 7. I haven't tested to see if any of the current plug-ins "just work" with it, though. I don't mind the extra steps, though - it went pretty quick once I figured out the flow. Like I said, maybe 20 min total for the sphere, the texture, export to .3DS, convert to FBX2013 and then to COLLADA - and that was because FBX has apparently changed since Max 7.... lol
@Dwarf - lol, no argument from me on that one. I'll give those videos a look - thanks!
#4
03/11/2014 (7:45 pm)
Ok, 2.69, r60995 of Blender.
#5
03/11/2014 (9:17 pm)
I am not sure what Max has over Blender in the case of export capabilities for Collada. You still have to set up a hierarchy of nodes and attach them appropriately, right? What was the problem in the Blender realm because I am curious of what problems you had. I used Blender and have made 5 races with animations, 5 monsters with animations, over 75 objects that are dynamic, and this does not even remotely touch the numerous static objects that you are describing in which you had problems exporting. Your feedback will be important for others that will need to decide what modeling program to use if they come across these posts.
#6
As far as the problem - I followed the steps in the original post and achieved the described result. I created a sphere, added a material, added a texture to the material, exported to COLLADA, imported to T3D and had a lovely untextured sphere - regardless of how much I fiddled with the material settings. I ensured that the textures were copied, checked the paths in the COLLADA file, checked the material.cs file and everything looked like it should have worked. Like I said, I must have missed something in there.
I'm not in any way saying that Blender is at fault here - I'm saying I have no idea why that didn't work. I ended up installing MAX 7 because I own it and am familiar with it - I already understand the modeling and exporting process in it pretty well and so I knew what I needed to do to achieve the desired results with it (even with the extra steps).
I intend to take a little time and watch the videos Dwarf posted - MAX 7 is very old and I can't afford to upgrade so it would behoove me to learn to use Blender. In this case frustration drove me to return to familiar territory.
03/11/2014 (10:18 pm)
Well, Max 7 has absolutely nothing over Blender when it comes to COLLADA export - it can't.As far as the problem - I followed the steps in the original post and achieved the described result. I created a sphere, added a material, added a texture to the material, exported to COLLADA, imported to T3D and had a lovely untextured sphere - regardless of how much I fiddled with the material settings. I ensured that the textures were copied, checked the paths in the COLLADA file, checked the material.cs file and everything looked like it should have worked. Like I said, I must have missed something in there.
I'm not in any way saying that Blender is at fault here - I'm saying I have no idea why that didn't work. I ended up installing MAX 7 because I own it and am familiar with it - I already understand the modeling and exporting process in it pretty well and so I knew what I needed to do to achieve the desired results with it (even with the extra steps).
I intend to take a little time and watch the videos Dwarf posted - MAX 7 is very old and I can't afford to upgrade so it would behoove me to learn to use Blender. In this case frustration drove me to return to familiar territory.
#7
Max 3D studio is an awesome program, but when we have Blender 2.69 all for free(one can donate gold coins and that I have done) there is really no need to upgrade as that Blender program can do the most and the workflow and the User Interface is actually really easy to learn. There are a huge bunch of resources/tutorials on the internet and even very nice affordable books one can buy.
When doing 3D work on Models I use Milkshape 3D, Blender and Ultimate Unwrap 3D Pro.
Blender is actually starting to replace more and more the other two I mentioned. Rigging models up with .bvh files are also pretty nice.
Max Studio would have to do a real brutal drop in price before I would even consider it as a tool for production(and I am really used to blender). Perhaps it is because my main providers of 3D models ship them in Blender and Milkshape files that I took this road back then :o)
Edit: I actually find Lightwave 3D to be a very strong tool to work with fbx files in. And even take 3ds files edit and export to collada with. So that is just another low cost option(however not free as blender) compared to 3dmax,
03/12/2014 (12:48 am)
Ah I see the texture/material thing. Well I had to play with that before the texture went with the model export. As far as I remember then you will need to tick include texture and copy in the left middle side of the screen(look for the red and white chess like icon and you will see the rest) after file -> export -> collada.Max 3D studio is an awesome program, but when we have Blender 2.69 all for free(one can donate gold coins and that I have done) there is really no need to upgrade as that Blender program can do the most and the workflow and the User Interface is actually really easy to learn. There are a huge bunch of resources/tutorials on the internet and even very nice affordable books one can buy.
When doing 3D work on Models I use Milkshape 3D, Blender and Ultimate Unwrap 3D Pro.
Blender is actually starting to replace more and more the other two I mentioned. Rigging models up with .bvh files are also pretty nice.
Max Studio would have to do a real brutal drop in price before I would even consider it as a tool for production(and I am really used to blender). Perhaps it is because my main providers of 3D models ship them in Blender and Milkshape files that I took this road back then :o)
Edit: I actually find Lightwave 3D to be a very strong tool to work with fbx files in. And even take 3ds files edit and export to collada with. So that is just another low cost option(however not free as blender) compared to 3dmax,
#8
No doubt Blender is a great tool and I plan to get to know it better.
03/12/2014 (7:00 am)
Quote:Did that - that's why I'm so confused.
As far as I remember then you will need to tick include texture and copy in the left middle side of the screen(look for the red and white chess like icon and you will see the rest) after file -> export -> collada.
No doubt Blender is a great tool and I plan to get to know it better.
#9
03/15/2014 (1:03 am)
Yeah I've never been very successful at importing stuff from Blender - it's always an uphill struggle. Though I know other people seem to have no problem with it so I chalk it up to incompetence :P.
#10
03/15/2014 (12:45 pm)
use blender 2.49B with the torque dts plugin. Screw collada XD
#11
Just beware of the directions(xyz) :o) Otherwise it works fine.
03/15/2014 (2:56 pm)
Quote:use blender 2.49B
Just beware of the directions(xyz) :o) Otherwise it works fine.
#12
In short: you need to UVUnwrap the mesh, and use the UVMap viewport to assign the texture to the UV.
Since this is Richard asking, I'll look over the Blender settings I use and I'll report back soon-ish.
Cheers!
07/09/2014 (7:11 pm)
This sounds like you are exporting the mesh to .DAE with an empty material. By only adding a material and a texture, the material still doesn't know where it's supposed to go. In short: you need to UVUnwrap the mesh, and use the UVMap viewport to assign the texture to the UV.
Since this is Richard asking, I'll look over the Blender settings I use and I'll report back soon-ish.
Cheers!
#13
Here's where we start with the actual wrap/unwrap stuff...
07/10/2014 (9:36 am)
Alright, here goes...- Open up Blender.
- There's a cube there, we'll use it for this example. It already has a material and a texture applied to it. By default, you can verify this in the top-right corner of the screen within the Outliner view pane:
- Just beneath this, you have a Properties pane with tabs up top for navigating the multiple facets of your mesh file:
- Select the 'Texture' tab (checkerboard icon, highlighted blue in above image).
- Near the top of the Properties pane you'll see a Type: field with a dropdown box. Click that and choose Image or Movie. When you do this, some of the sections within the properties pane below change a bit.
- A bit further down you'll see the 'Image' section. Click open and pick your texture.


Here's where we start with the actual wrap/unwrap stuff...
- With your texture selected, there is one last thing to check while you are in the Properties pane. A bit below the 'Image' section you'll find the 'Mapping' section. Within this section, the first field is Coordinates. Click the dropdown box next to that and choose 'UV'. Upon doing so, a new Map field appears directly below the Coordinates field:
- Click the checkered circle next to the Map: field. The popup window is empty! This is because we have no UVMap just yet for this texture to use! Let's fix this now:
- Back up top in the Outliner pane, you'll see that the Cube mesh is represented by two triangles in the viewport. The golden triangle represents the Cube's 'Object Mode' and the white triangle represents the Cube's 'Edit Mode'. Click the white triangle to enter Edit Mode.
- When you enter Edit Mode, the Cube's edges are now outlined in black and the vertices are highlighted with thick black dots as well. In this mode, you can manipulate the mesh's data (i.e. the fun stuff! ) although for the purposes of this tutorial we won't be using any of the transformation manipulators:
- Be sure your mouse cursor is within the bounds of the 3D viewport and press T to remove the 'Transform' pane that is tagging itself to the left side of your screen. We'll need the extra space for the next step.
- Look in the bottom-left corner of the 3D-viewport for the 3 diagonal lines used to resize the viewport. Click the corner there and drag it to the right, effectively creating a new viewport to rest side by side with the original 3D viewport:
- Now in the new left-most viewport, again look to the bottom left of the viewport but this time click the viewport selection button (right above the diagonal lines used to move the viewport, and also shown in the image above with the cube on the button and 2 small arrows). Choose UV/Image Editor. A flat blank graph appears, nice. We're now ready to 'Unwrap' the cube.
- Be sure your mouse cursor is within the bounds of the 3D viewport and press A. The entire mesh is highlighted, indicating that all of the mesh's geometry is selected.
- Be sure your mouse cursor is within the bounds of the 3D viewport and the mesh is selected and press U. In the popup that appears, choose 'Smart UV Project' and in the next popup just hit OK for now.



#14
07/10/2014 (9:38 am)
- If you've done everything correctly up to this point, you'll now see the mesh's unwrapped UV coordinates lying flat and neat in the UV/Image Editor viewport:
- The hard part's done, now all we've got to do is take this UV and put a texture to it! In the toolbar of the UV/Image Editor viewport, you've got a couple options as to how you can add the image. One quick method is to be sure your mouse cursor is within the bounds of the UV/Image Editor viewport and hit Alt-O. Navigate to the image and click 'Open Image' in the top right of the navigation window. However, since we already chose a texture earlier within our Properties pane (on the right side of the screen), we can use a shortcut:
- Click the icon shown above that looks like a picture, located on the UV/Image Editor toolbar. You'll find your texture in the popup menu, click that:
- You should now see the texture in the left viewport, laid out to fit the UV coordinates. You may need to zoom the mouse wheel in or out to adjust your perspective to taste. Here you can press S and move the mouse to scale (left-click to accept or right-click to cancel). You can also press R and move the mouse to rotate (left-click to accept or right-click to cancel). G for 'Grab' or standard x,y,z :)
- Now we will return alas to our Mapping section in our Properties pane (on the right side of the screen). We'll find that if we now click the checkered circle to select our UVMap that our UVMap is now listed:
- Select 'UVMap' from the popup.
- As of now, your model is good to go. But as it goes with these things, it pays to be thorough...
- In the top right of the 3D viewport, click the + symbol to open yet another pane (or be sure your mouse cursor is within the bounds of the 3D viewport and press N). This new pane will rest between the far-right properties pane and the 3D viewport. Browse down this new pane until you find the 'Shading' section. Expand that section and click the checkbox labeled 'Textured Solid'.
- If all goes well, for your convenience you should now be able to see the texture on the cube within your 3D viewport:
- If you haven't been saving all along, shame on you! Save now, and click the File -> Export -> Collada (default)(.dae) option. Enjoy your .DAE export!





#15
All along I've been convinced that I must be missing something somewhere - I've seen others succeed in this so I know it can be done. Thanks for the nice, clean instructions Jesse!
07/10/2014 (12:03 pm)
I'll give it a go and let you know if I can get my head out of my backside.... lolAll along I've been convinced that I must be missing something somewhere - I've seen others succeed in this so I know it can be done. Thanks for the nice, clean instructions Jesse!
#16
P.S. I've learned literally countless concepts with TorqueScript thanks to you. By studying your guides and, even moreso, github resources I'm beginning to do some cool stuff with script. Just recently, I scripted a working drag-drop inventory system for Torque 3D that equips weapons dragging and dropping from inventory to character window. It was your initial introduction to passing data in your Torque 2D example that empowered me to do so. The thanks go to you my friend!
07/11/2014 (5:45 am)
No problem Richard. It seems like a topic others may find useful as well. I know that if you are asking, then there certainly needs to be some extra information available :)P.S. I've learned literally countless concepts with TorqueScript thanks to you. By studying your guides and, even moreso, github resources I'm beginning to do some cool stuff with script. Just recently, I scripted a working drag-drop inventory system for Torque 3D that equips weapons dragging and dropping from inventory to character window. It was your initial introduction to passing data in your Torque 2D example that empowered me to do so. The thanks go to you my friend!
#17
It'd be cool to see a video of that inventory in action, too....
07/11/2014 (12:52 pm)
Glad to be of service! This is the sort of thing that really shines here - the programmers provide information that helps the artists, the artists provide information that helps the programmers.... a veritable pot-luck of Torque learning.It'd be cool to see a video of that inventory in action, too....
#18
In any event, I did take note as I was scripting all that how useful it could potentially be for our community. It's an expansion on the existing TorqueScript-based inventory system. I basically hook into the existing inventory callback functionality (because it's quite nicely implemented and useful tbh) with my GUI. So it's all (kinda) easily plugged into Torque with no source changes, but the TorqueScript involves several files and functions, etc. etc.
Additionally, another resource I've created is an .xml write/read on character login and exit of the server...but I think that one will wait till a bit later :)
07/13/2014 (12:24 am)
Of course! It's pretty late atm, but I'll try to put something together soon-ish to show you man. I really want to finish a couple other areas of the GUI before unleashing it on the world. The GUI is fairly basic, but yea that drag/drop equip is nice. It paves the way for much greater things in the future... In any event, I did take note as I was scripting all that how useful it could potentially be for our community. It's an expansion on the existing TorqueScript-based inventory system. I basically hook into the existing inventory callback functionality (because it's quite nicely implemented and useful tbh) with my GUI. So it's all (kinda) easily plugged into Torque with no source changes, but the TorqueScript involves several files and functions, etc. etc.
Additionally, another resource I've created is an .xml write/read on character login and exit of the server...but I think that one will wait till a bit later :)
#19
Reshaped Choose Level dialog -
Choose Level Dialog
Click button in the scroller to select your in-game player model, like so -
Current Game UI
I've also pointed out the Twillex-driven rollout panels. The buttons were added dynamically but I intend to be able to drag and drop them from other pop-up windows in the UI.
And here's a way to roll through your model datablocks and get information to drive that player model selection:
Edit - I hate OneDrive links....
07/13/2014 (10:10 am)
Some of my fiddlings:Reshaped Choose Level dialog -
Choose Level Dialog
Click button in the scroller to select your in-game player model, like so -
Current Game UI
I've also pointed out the Twillex-driven rollout panels. The buttons were added dynamically but I intend to be able to drag and drop them from other pop-up windows in the UI.
And here's a way to roll through your model datablocks and get information to drive that player model selection:
$PlayerDatablocks = new SimSet()
{
class = "PlayerDatablockList";
};
function PlayerDatablockList::init(%this)
{
%this.clearDatablocks();
%this.loadData();
}
function PlayerDatablockList::addDatablock(%this, %datablock)
{
if(!%this.isMember(%datablock))
%this.add(%datablock);
}
function PlayerDatablockList::clearDatablocks(%this)
{
while(isObject(%obj = %this.getObject(0)))
{
%this.remove(%obj);
}
%this.clear();
}
function PlayerDatablockList::loadData(%this, %path)
{
// find main.cs
%search = "art/datablocks/aiPlayer/*.cs";
// search for scripts and load them
for( %file = findFirstFile( %search ); %file !$= ""; %file = findNextFile( %search ) )
{
%this.readDatablockInfo(%file);
}
}
function PlayerDatablockList::readDatablockInfo( %this, %fileName )
{
%infoObject = new ScriptObject();
%infoObject.shapeFileInfo = "";
%infoObject.datablockName = "";
%file = new FileObject();
%validFile = false;
if ( %file.openForRead( %fileName ) )
{
%validFile = true;
%inInfoBlock = false;
%dbNameFound = false;
while ( !%file.isEOF() )
{
%line = %file.readLine();
%line = trim( %line );
%tempLine = strreplace(%line, "datablock PlayerData(", "");
if( %line !$= %tempLine ) // deduction by negatives - this is the start of a PlayerData datablock
%inInfoBlock = true;
else if( %inInfoBlock && %line $= "};" )
{
%inInfoBlock = false;
%infoObject = %infoObject @ %line;
break;
}
if( %inInfoBlock )
{
if (!%dbNameFound)
{
// find datablock name
%schloc = strchr(%tempLine, ":");
%dbName = trim(strreplace(%tempLine, %schloc, ""));
%infoObject.datablockName = %dbName;
%dbNameFound = true;
}
else
{
%tempLine = strreplace(%line, "shapeFile = ", "");
if (%line !$= %tempLine) // found the shapefile entry
{
%sfName = trim(strreplace(%tempLine, """, ""));
%sfName = strreplace(%sfName, ";", "");
%infoObject.shapeFileInfo = trim(%sfName);
}
}
}
}
%file.close();
}
else
{
%validFile = false;
error("Datablock file " @ %fileName @ " not found.");
}
%file.delete();
%this.addDatablock(%infoObject);
}
$PlayerDatablocks.init();This way you don't have to even load the datablocks yet - saves time and prevents reordering how the system loads datablocks, because they're not loaded until later....Edit - I hate OneDrive links....
#20
07/13/2014 (11:53 am)
Holy...that's amazing Richard! I can understand for the most part what you've got there, but would need to chew on it a bit to fully grasp it all. Thanks for the ideas!
Torque Owner Dwarf King
Noble Games Production
Also follow these two links:
Collada to Torque 3D - Part 1 of 2
Collada to Torque 3D - Part 2 of 2
I have used these videos and exported several models to collada from Blender and they worked fine in Torque 3D.
It is very easy :o)
Experience with Blender :o)