Shard Posted April 17, 2010 Share Posted April 17, 2010 Hey guys. I'm coding a specific version of our game for a cinematic. Basically, Porsche will create animations in 3DS and then we will place it in the code. Then the code will read it in and create mesh objects for them. Finally, he can hit "play" and all the animations would run from start to finish. Then we will Fraps it. The problem that I'm having is doing this: //Initialization string objectName; // For aStar stuff if(className == "animation") { TMesh mesh; className = "\"abstract:" + className; className = className + ".gmf\""; mesh = LoadMesh(className); //<------ error C2664: 'LoadMesh' : cannot convert parameter 1 from 'std::string' to 'str' } The object name is defined in the Editor and is the same as the gmf file. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
ArBuZ Posted April 17, 2010 Share Posted April 17, 2010 sdt::String has c_str() method use it. It should work. Quote Q6600@2.4GHz - 9600GT - 4GB DDR2@800MHz - Windows7 x64 3ds max / photoshop CS3 / C++ http://www.arbuznikov.com Link to comment Share on other sites More sharing options...
Shard Posted April 17, 2010 Author Share Posted April 17, 2010 sdt::String has c_str() method use it. It should work. Thanks. I did this and I got a new error error C2664: 'LoadMesh' : cannot convert parameter 1 from 'const char *' to 'str' I did a Google search on the error but I couldn't find a solution. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
ArBuZ Posted April 17, 2010 Share Posted April 17, 2010 Try this: string myString; ...... LoadMesh(str(myString.c_str())); Quote Q6600@2.4GHz - 9600GT - 4GB DDR2@800MHz - Windows7 x64 3ds max / photoshop CS3 / C++ http://www.arbuznikov.com Link to comment Share on other sites More sharing options...
Shard Posted April 17, 2010 Author Share Posted April 17, 2010 Try this: string myString; ...... LoadMesh(str(myString.c_str())); Thank You, worked perfectly. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK 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.
Note: Your post will require moderator approval before it will be visible.