Maya plugin using a .dll

Hi, we did a maya plugin that needs a .dll to run. The only way we can access the .dll vie the maya plugin is to put the .dll file in a folder listed in the window %PATH% environment variable or write a absolute path in the c++ code.

I saw many plugins using .dll where you didn;t have to put the .dll in a system %PATH% folder. You would just put the plugin file (.mll) and the .dll in a folder listed in the MAYA_PLUGIN_PATH and it works fine.

What am I doing wrong? how do I have to call the .dll so that maya can access it.

Thanks

Hey Kobayashy...

I'm able to load .dlls via a defined "PATH" variable in the .env. Try it, and see if it works.

PATH = D:tempbin

put your .dlls in the bin.

Shawn

Maybe I didn't write my problem properly, but I don't want to have to put my .dll in a path listed in the %PATH% variable.

I wan to put the .dll in the same folder as the .mll without having to hardcode the absolute path in the plugin.

This way the plugin can be install in any folder listed in the MAYA_PLUG_INS_PATH without having to had a path to the windows %PATH% variable on the machine I install the plugin

then add the maya plugin directories to your system path.

only other way is to append each of the maya plugin paths to the front of your dll and attempt to load it - probably a waste of time though, since setting the system path will fix it (and is usually the first place an experianced td will be looking to solve problems like this).

Most projects i've worked on, have had a standard bin directory for these kinda things - i'm slightly puzzled as to why the normal method of doing this is so bad?

The reason is simple, I am getting tired of having to either copy 1 file on all 200 computers or set an environment variable on each machine. I did it too many times, for scripts, plugins, mental ray shaders, etc.

I would probly not complain as much if we where on Linux, but this is not the case, and windows scripting for this kind of thing is not that good. We used windows scripting once to make sure all computers had the proper environment variables, and I ended up doing most of them by hand.

well if your question is how to avoid copying and pasting files all over the place, then this might be of use

I've used the following methods before with varying degrees of success. I can't say that any-one method is perfect, but a combination usually works for a given project.

  • an installer per project for the art tools

  • http://www.kixtart.org/ - use kix (quick and dirty) for a logon script to update the toolset by querying a vss or cvs database when the animator logs on. Should be able to use it to set the paths you need at logon. If the logon script is then on a server, just edit that. Where the scripts, plugins, shaders etc go is then defined when you check them into CVS or VSS.

  • use mel to do a full get on cvs or vss at maya startup, dump all dll's in C:/windows/system32 within the VSS tree. The only file then really required to be installed in the correct place is userSetup.mel

  • set all paths to a server rather than on the local machine. Then just need to update one set of files on the server.

I'd also have a look at something like Norton Ghost to set up a default Win32 build with all paths and any startup scripts set up correctly. It's then just a case of putting the same build on all machines. Not exactly an ad hoc fix, but definately worth it in the long run.

Thanks for the tip on kixtart, I will check this out.

Presently I have setup all maya to load plugins and scripts from a network folder, and I use maya.env to setup environment. the only bug left is the .dll problem, this might help me rosolve this.

what so hard about doing abat file with

copy to unc path
and
set to set the value?

i mena its a for loop and 3 lines of code in windows batch?!?

really? 3 lines to do this? list all computer of the park to copy the file to, make sure the user running the script has the rights to copy the file, copy the file, return a success or failure message.

Like I said, we have a script that do it. but on 25% of the computers for some reasons the connection fails, the permission on a machine are bad, stuff like that. So I end up doing it by hand to make sure... this is windows we are talking about. A OS where remote desktop stop working on some machine for no reason, that doesn't have a decent shell language, etc, etc.

Anyway, i'll do it by hand.

Youd need domain admin rights to fdo this offcourse...

Wierd that it doesnt work we have 500 computers (theese are just the public computers of one small part) with 10000 users (all with own profiles, network home directories et in windows) at my university and it works mostly wthot a hitch to remottely install everything all progs all modules etc. etc. Its not that hard!

No but wbscript can do thi easily

Example

i'll check this scripting language. Thanks for the link.

it comes with windows.

it comes with windows.