MOD not loading

MOD not loading

FalconCrest
Advisor Advisor
4,177 Views
18 Replies
Message 1 of 19

MOD not loading

FalconCrest
Advisor
Advisor

I modify a .MOD file then placed the MOD file in my environment path, changed the settings in the MOD file as mentioned here; restarted Maya and the tool isn't loading ? Then I ran this script;

 

getModulePath –moduleName “{name of module}”

 

+MAYAVERSION:2015 PLATFORM:win64 {tool name} {path of MOD file on your HDD}
PATH+:=bin

 

 

0 Likes
Accepted solutions (2)
4,178 Views
18 Replies
Replies (18)
Message 2 of 19

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Hi FalconCrest,

 

After checking your mod, I think that you probably have misplaced the .mll file.

 

According to our document

 

When creating the module you place your icons in the icons subdirectory, your C++ and Python plug-ins in the plug-ins subdirectory, your presets in the presets subdirectory (same structure as Maya's presets directory) and your MEL and Python scripts in the scripts subdirectory.

 

The plugin should be placed in the subfolder plug-ins.

 

Once I moved your plugin into that folder and restarted Maya, it is shown in the plugin window.

 

hmtools.png

 

Yours,

Li

0 Likes
Message 3 of 19

FalconCrest
Advisor
Advisor

It works, I followed the mention you mentioned and it wasn't working two weeks ago.

Can you not place scripts in their own folder, I find it a mess to have all my scripts or mll files thrown in a folder ?

0 Likes
Message 4 of 19

FalconCrest
Advisor
Advisor
The answer is found, I was hoping you could help with the question posted above ?
0 Likes
Message 5 of 19

cheng_xi_li
Autodesk Support
Autodesk Support

I think there is a subfolder called scripts for putting the scripts.

 

Maya is also using mod for xgen and biforst, you can use them as a reference.

0 Likes
Message 6 of 19

FalconCrest
Advisor
Advisor
Can you place scripts in Subfolders and they will continue to work once in Subfolders; regardless if there Python or MEL ?
0 Likes
Message 7 of 19

FalconCrest
Advisor
Advisor

For example, suppose all your scripts reside in
>MyScripts

I want to place individual scripts in sub-folders of the parent folder {MyScripts}

>MyScripts
>>ScriptA
>>>ScriptB
>>>>ScriptC
>>>>>ScriptD

Will there be any problems when executing the scripts in the sub-folders ?

From what I know Python scripts can be placed in sub-folders, as long as they have the __init__.py file in the subfolders.

 

The script hmtools, like some other scripts, includes a MOD file, from what I understand from this [link] and this [link] you can install these scripts anywhere; by simply modifying the first line in the MOD file to the path of the script ? I've done this with, for example, this particular script, but what is the typical command one needs to run when wanting to install MOD files ?

 

DLL files are Mental Ray Shader Libraries, I have a custom path for Mental Ray Shaders, but this shader does not show in the hypershade ?

0 Likes
Message 8 of 19

cheng_xi_li
Autodesk Support
Autodesk Support

I think there shouldn't be ok for the scripts.

 

 

For scripts folder, there is a scripts parameter in the mod. As long as you set a correct path, it should be ok to put it elsewhere.

 

For mental ray shaders, I think you need to add an environment variable for it or put inside the mental ray shader folder(link).

0 Likes
Message 9 of 19

FalconCrest
Advisor
Advisor

Q===========================

   I think there shouldn't be ok for the scripts.

Q===========================

 

I don't understand ?

 

Q===========================

   For scripts folder, there is a scripts parameter in the mod. As long as you set a correct path, it should be ok to put it elsewhere.

Q===========================

 

What area of the mod should have the current path, should it be a relative path or a absolute path ? How do you typically execute the mod to install ?

 

Q===========================

   For mental ray shaders, I think you need to add an environment variable for it or put inside the mental ray shader folder(link).

Q===========================

 

  I have MI_LIBRARY_PATH as a environment variable, but the DLL files I place in this folder, are not loading in hypershade ?

 

0 Likes
Message 10 of 19

cheng_xi_li
Autodesk Support
Autodesk Support

Oh, sorry for the typo. I mean it should be ok for putting mel in subfolders.

 

 

What area of the mod should have the current path, should it be a relative path or a absolute path ? How do you typically execute the mod to install ?

 

I think either of them(absolute and relative path) is OK. For xgen and biforst, we are using relative path because they are installed with Maya. For third party plugins, absolute path might be better because user may install them any where on their harddrives.

 

I have MI_LIBRARY_PATH as a environment variable, but the DLL files I place in this folder, are not loading in hypershade ?

 

What about the .mi files? Have you also put them in the environment path(MI_CUSTOM_SHADER_PATH)?

0 Likes
Message 11 of 19

FalconCrest
Advisor
Advisor
MI files load successfully from the custom path; although as I mentioned; that is not the case with DLL or the MI_LIBRARY_PATH ?



0 Likes
Message 12 of 19

cheng_xi_li
Autodesk Support
Autodesk Support

Do you mean that using module to load dlls used by a mental ray shader?

 

I don't think the module will work that way, maybe you can try with the path settings in the module. 

0 Likes
Message 13 of 19

FalconCrest
Advisor
Advisor
I mean; placing a mental ray DLL shader into a custom path won't load the custom shader in Maya ?
0 Likes
Message 14 of 19

cheng_xi_li
Autodesk Support
Autodesk Support

Mental Ray dll shader and its include header(.mi) should be loaded through the instruction of Mental Ray plugin(Mayatomr.mll). If you put it inside a mod path and try to load it directly, I don't think it will work.

0 Likes
Message 15 of 19

FalconCrest
Advisor
Advisor

Not all mental ray shaders include the header (mi) file as you put it ! 🙂

 

What do you mean it should be loaded from the Mental Ray plugin from nVidia ?

0 Likes
Message 16 of 19

cheng_xi_li
Autodesk Support
Autodesk Support

Mental ray is a render plugin shipped with Maya and mental ray custom shader dll requires mental ray plugin to load them to work.

e.g.

// mental ray for Maya: successfully registered
// mental ray for Maya: loading startup file: C:/Program Files/Autodesk/mentalrayForMaya2015//maya.rayrc
// parsing C:/Program Files/Autodesk/mentalrayForMaya2015/shaders/include/abcimport.mi
// loading C:/Program Files/Autodesk/mentalrayForMaya2015/shaders/abcimport.dll

...

 

I know that mental ray shaders could be scripts, but I've never tried a mental ray custom shader dll without header file before. For example, the maya shaders' mental ray plugin, they are having both .mi file and the dll library. 

 

Can I have more details of your plugin? Is it a mental ray custom shader written in C or a maya plugin or mixed(having both maya version and mental ray version)? 

0 Likes
Message 17 of 19

FalconCrest
Advisor
Advisor
Hopefully you can help me understand how to install; an anything identical in the future.
0 Likes
Message 18 of 19

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

I downloaded the file in the link. There are include,dll,AETemplate inside of it. I copied them into mentalray folder(dll->shaders, .mi->shader/include, AETemplate->scripts/AETemplate) and I can find them in hypershade(mental ray|texture).

 

I also tried to put them in the environment path, it is working fine also.

 

0 Likes
Message 19 of 19

FalconCrest
Advisor
Advisor
Possible I didn't copy all the file, try again 🙂
0 Likes