|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| Get environment map\texture name. And calling maxscript functions problem
|
|
|
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 3dsmax, this 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 LNK2001: unresolved 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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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_ID, 0))
{
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 = 0; i < filePath.length() ++i)
if (filePath[i] == '\\')
{
filePath.insert(i, 1, '\\')
++i; // Skip inserted char
}
fprintf(s_pStream, "\"string mapname\" [\"%s\"] \n", filePath.data())
}
}
http://www.stigatle.net
|
|
|
|
|
|