Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / SDK / Get environment map\texture name. And calling maxscript functions problem
  RSS 2.0 ATOM  

Get environment map\texture name. And calling maxscript functions problem
Rate this thread
 
41335
 
Permlink of this thread  
avatar
  • Location: Kristiansand - Norway
  • Total Posts: 193
  • Joined: 20 December 2006 03:43 AM

Hi,

Been trying today to call maxscript functions from SDK.
The reason for this is because I’m helping with a exporter.
What I’ve been trying to do is to get the path and filename of the environment map (if it’s a texture map).

The code for running the script is the following:

ExecuteMAXScriptScript("print \"Hello 3dsmaxthis is the SDK calling!\"")

I’ve checked out some solutions here on the forum, but I keep getting the same error when compiling:

Error 2 error LNK2001unresolved external symbol "__declspec(dllimport) int __cdecl ExecuteMAXScriptScript(char *,int,class FPValue *)" (__imp_?ExecuteMAXScriptScript@@YAHPADHPAVFPValue@@@Z) LuxMax.obj Luxrender

I have no clue what so ever on what to do..

And if any of you know how to “get path to environment texturemap” and want to help, then please let me know.. (This is what I want do do through maxscript - because for me it seems very hard to get the info I need from SDK..).

Thanks in advance.



http://www.stigatle.net

Replies: 0
avatar

This looks like a linking error. Are you linking your project against the file MAXSCRPT.LIB? If you are, and still getting that error, please post a list of the libraries you are linking. Thanks!



Christopher Diggins, M&E SDK Specialist
For 3ds Max SDK questions also check out http://stackoverflow.com/questions/tagged/3dsmax

Replies: 0
avatar
  • Location: Kristiansand - Norway
  • Total Posts: 193
  • Joined: 20 December 2006 03:43 AM
  • Permlink of this post

I’ve pointed my VS to the lib folder - is this enough? or do I have to do more?
that folder contains all the lib’s from the SDK



http://www.stigatle.net

Replies: 0
avatar
  • Location: Kristiansand - Norway
  • Total Posts: 193
  • Joined: 20 December 2006 03:43 AM
  • Permlink of this post

Got the environment map stuff sorted through the sdk.
it get’s the map name as : C:\\folder\\filename.ext

Interface* ip2 GetCOREInterface7()
   MCHAR
name;
   
MSTR name2;

Texmap *tmap;
if 
(ip2->GetUseEnvironmentMap())
  {
 
if (tmap ip2->GetEnvironmentMap())
 {
 
if (tmap->ClassID() == Class_ID(BMTEX_CLASS_ID0))
 {
 BitmapTex 
*bmt (BitmapTex*) tmap;
 
name bmt->GetMapName()
 std
::string namestring std::string(name)
 MaxSDK
::Util::Path path(_M(name))
 std
::string filePath path.GetString()

 
for (int i 0filePath.length() ++i)
 
if (filePath[i] == '\\')
 {
 filePath
.insert(i1'\\'
 
++i// Skip inserted char
 
}
 fprintf(s_pStream
"\"string mapname\" [\"%s\"] \n"filePath.data())
 }
  }


http://www.stigatle.net

Replies: 0