Start a new topic

mgReadColorPalette and mgReadMaterialFile

Original Post by: perezucf Tue Nov 12 22:33:56 2013

I saved a color and material palette with creator that I want to load into my model in my stand alone application. I am using mgReadColorPalette and mgReadMaterialFile with my db and the filename of the color and materials files I saved in the same directory as my executable. Those calls always return false. Other than opening the db is there anything else I need to do? Are they supposed to be in a certain location?

Original Post by: SteveThompson Tue Nov 12 22:42:38 2013

These functions accept the file name as a parameter. If they are failing, I will assume the functions are not finding the files where you tell them they are. Let's focus on why the files may not be found.

You say the files are saved in the same folder as your executable. Does that mean you are calling the function with just the file name (and not path)? If that is the case, make sure the "working directory" is setup up correctly when you run your executable. If you specify no path in the file name, these functions will look in the "working directory" for the un-pathed file. If you are running in the MSVS debugger the "working directory" is setup from the Debug properties of your project and is not necessarily the same folder as your executable. If you are running from the command line, the working directory is the folder you are currently in.

If you still can't get that to work, try a fully qualified file name including path when you call the function. Let's make sure the file is found before we start looking elsewhere for problems.

Original Post by: perezucf Tue Nov 12 23:04:18 2013

Working directory was not set up right like you said. thanks.

Login to post a comment