Scottie Sirius Posted October 20, 2015 Share Posted October 20, 2015 I thought I read somewhere on the GG forums that we could export shapes made with Sketch Tool out as collada files. Is that still the case? I don't see the option in my current build.EDIT: We got it working but the dae it exports seems to be corrupt. Any ideas? Quote Link to comment Share on other sites More sharing options...
Duion Posted October 21, 2015 Share Posted October 21, 2015 Yes they are corrupt, you have to fix them by hand. Quote Link to comment Share on other sites More sharing options...
Scottie Sirius Posted October 21, 2015 Author Share Posted October 21, 2015 hey Duion, thanks for the reply. How do you fix them by hand? Is there info anywhere? Quote Link to comment Share on other sites More sharing options...
Mud-H Posted October 21, 2015 Share Posted October 21, 2015 hey Duion, thanks for the reply. How do you fix them by hand? Is there info anywhere?+1 :geek: Quote Link to comment Share on other sites More sharing options...
Duion Posted October 21, 2015 Share Posted October 21, 2015 I don't know, but when I opened the files in notepad I could fix them and I'm not a programmer, I forgot what it was, but the exporter in Torque puts some settings into the collada file blender cannot import so you have to remove them. Quote Link to comment Share on other sites More sharing options...
Mud-H Posted October 22, 2015 Share Posted October 22, 2015 Yeah I tried a while back to figure what is wrong in the Collada file by comparing with a working one and couldn't figure what was wrong. It's broken for a long time now, would be nice if someone find the problem so we could expect a fix in an incoming release.It could make the SketchTool quite usefull if we could export the Convex Shapes to have size reference for some modelling, without that feature, the SketchTool is quite useless :( Quote Link to comment Share on other sites More sharing options...
Mud-H Posted October 22, 2015 Share Posted October 22, 2015 I gave a closer look to the exported COllada and I think I have find what's wrong. Some space seem missing between some coordinate. Here the Position Coordinate for a base cube made with ConvexEditor: <float_array id="ConvexBox-Position-array" count="24">1.1940 -1.4000 1.1492-1.1940 -1.4000 1.1492-1.1940 1.4000 1.14921.1940 1.4000 1.1492-1.1940 -1.4000 -1.14921.1940 -1.4000 -1.14921.1940 1.4000 -1.1492-1.1940 1.4000 -1.1492 </float_array>As you can see, some coordinate are "glued" making number with 2 dots. (-1.14921.1940). I test various 3D tool and one of them gave me a hint:// complain if the index count doesn't fit if( expectedPointCount > 0 && indices.size() != expectedPointCount * numOffsets) { if (pPrimType == Prim_Lines) { // HACK: We just fix this number since SketchUp 15.3.331 writes the wrong 'count' for 'lines' ReportWarning( "Expected different index count in <p> element, %d instead of %d.", indices.size(), expectedPointCount * numOffsets); pNumPrimitives = (indices.size() / numOffsets) / 2; } else ThrowException( "Expected different index count in <p> element."); } else if( expectedPointCount == 0 && (indices.size() % numOffsets) != 0) ThrowException( "Expected different index count in <p> element.");This is where the tool failed: Expected different index count in element.If you take my previous example, the count is 24 but with the bad coordinate, it doesn't fit. When you count with fixed coordinate, the result is 24. I will now attempt to fix it and see how it goes :?EDIT: I gave up after 2 hours of trial and errors... I got my ConvexBox to load in Open3DViewer but with 3 triangles instead of 12... Something seem wrong the way T3D export the Collada, it's not just about the missing spaces in coordinate. I will need to read more about COllada format to keep investigating (Hoping someone with better skills can get through it) Quote Link to comment Share on other sites More sharing options...
Scottie Sirius Posted October 22, 2015 Author Share Posted October 22, 2015 Thanks for the help guys. I hope you can figure it out Mud-H. I need to get dimensions and protrusions of our ship interior so we can make an outer hull more effectively. Quote Link to comment Share on other sites More sharing options...
Mud-H Posted October 22, 2015 Share Posted October 22, 2015 Something I did a while back to get in-game dimensions was to add a basic 1meter(unit) cube and scale it to the size I want. Then you simply set the same scaling to the cube in your 3D modelling tool. Nothing magic but it worked.Also with the Transform Tools, you can get the dimensions of shapes so you can use a box as a ruler...Not sure if it help, I guess you are looking for a more precise method. Quote Link to comment Share on other sites More sharing options...
Scottie Sirius Posted October 22, 2015 Author Share Posted October 22, 2015 naw, I can do it that way too but I just kind of 'rediscovered' the sketch tool and thought I'd make use of it. Quote Link to comment Share on other sites More sharing options...
SqHd Posted October 30, 2015 Share Posted October 30, 2015 I remember dealing with this in the past and discovered a work around (back in 2010) using the Autodesk FBX converter, but was surprised to find it doesn't work anymore.So I compared a Collada export from T3D 1.2 to the current version. Mud-H was on the right track with the spacing. It just needs to be separated line by line.T3D 1.2<source id="t3d1cube-Position"> <float_array id="t3d1cube-Position-array" count="24"> 0.5000 -0.5000 0.5000 -0.5000 -0.5000 0.5000 -0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 -0.5000 -0.5000 -0.5000 0.5000 -0.5000 -0.5000 0.5000 0.5000 -0.5000 -0.5000 0.5000 -0.5000 </float_array> T3D 3.8<source id="t3d3cube_orig-Position"> <float_array id="t3d3cube_orig-Position-array" count="24">0.5000 -0.5000 0.5000-0.5000 -0.5000 0.5000-0.5000 0.5000 0.50000.5000 0.5000 0.5000-0.5000 -0.5000 -0.50000.5000 -0.5000 -0.50000.5000 0.5000 -0.5000-0.5000 0.5000 -0.5000 </float_array> Once the coordinates are separated line by line (there are 4 sections that this needs to be done), the file can be converted to FBX, then the FBX to OBJ using the latest Autodesk FBX Converter (which can be downloaded for free). Finally, the OBJ can be imported into Blender (no textures though). Obviously, editing the file line by line is way too tedious a process, so I started to delve into the source files.At some point there were changes made in these two files (which deal with collada export information): colladaUtils.cpp and colladaUtils.hUsing WinMerge to compare the files, the differences were mostly converting 'int' to 'S32' and a 'double' to 'F64'It would be great if a programmer could shed some light on why this would affect the line output to be one long line (with out the carriage returns). Hopefully, we can get it to function like it did in T3D 1.2 and use the converter to get our Sketch Tool creations in Blender. Quote Link to comment Share on other sites More sharing options...
JeffR Posted November 2, 2015 Share Posted November 2, 2015 To clarify on it, with the spacing correction back in there, does it still not import correctly into blender without first passing it through FBX and OBJ? Quote Link to comment Share on other sites More sharing options...
SqHd Posted November 2, 2015 Share Posted November 2, 2015 Hi Jeff.That's correct. Even with the correct spacing, the collada file still needed to go through the conversion work around to get into Blender. (It wasn't too much of a pain since the Autodesk converter allowed for batch conversion.)Also, I was doing some more digging last night and the collada output files changed (the spacing) with the 3.0 release. This is the release where the DIF interiors and "export DIF interior to collada" were taken out.Finally, these files (colladaUtils.cpp and colladaUtils.h) didn't mess up the spacing as I had previously assumed. The 2.0 and 3.0 versions are the same. Quote Link to comment Share on other sites More sharing options...
Johxz Posted November 26, 2016 Share Posted November 26, 2016 Hey hi, I was quick reviewing this and I found the problem. I start played with the Sketch Tool and did a little more complex building and this solution fixed the load into Blender3D 2.78a and can export already dts files into Blender3D.If you wanna tested T3D_ColladaExporter (15MB)Open Issue: https://github.com/GarageGames/Torque3D/issues/467Open PR: https://github.com/GarageGames/Torque3D/pull/1831 Quote Link to comment Share on other sites More sharing options...
SqHd Posted November 27, 2016 Share Posted November 27, 2016 @Johxz: Wow! Great work! This is awesome. Thanks for the fix. I did some testing tonight and works like a charm. It's so nice to have this functionality back. Hope it makes the cut for 3.10. Quote Link to comment Share on other sites More sharing options...
Johxz Posted November 28, 2016 Share Posted November 28, 2016 I'm doing a few video tutorials, I want to show one of the potential to use the sketch tool and then export to collada. Quote Link to comment Share on other sites More sharing options...
SqHd Posted December 2, 2016 Share Posted December 2, 2016 Very cool. I subscribed to your channel. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.