No, don't do this with the API.
I just checked how the Maxwell Renderer is inserted and it's just like the Mental Ray renderer, the first post I posted.
Mental Ray modifies
CODE
// mental ray camera attributes
if (exists AEmentalrayCamera
)
AEmentalrayCamera $nodeName;
in the AEcameraTemplate
while the Maxwell Renderer replaces Maya's original AEshapeTemplate, which looks like this
CODE
global proc AEshapeTemplate ( string $nodeName )
{
editorTemplate -beginLayout "Object Display";
AEdagNodeCommon $nodeName;
editorTemplate -endLayout;
AEdagNodeInclude $nodeName;
}
with this:
CODE
global proc AEshapeTemplate(string $nodeName)
{
global string $AEshapeHooks[];
$numHooks = size($AEshapeHooks);
for($i=0; $i<$numHooks; ++$i)
eval($AEshapeHooks[$i] + " " + $nodeName);
editorTemplate -beginLayout "Object Display";
AEdagNodeCommon $nodeName;
editorTemplate -endLayout;
AEdagNodeInclude $nodeName;
}
This is the reason why I told you to look after the function which calls "maxwellShapeNodeAEHook", which indirectly turns out to be "maxwellRegister" through the call "addShapeNodeAEHook('maxwellShapeNodeAEHook');" where "addShapeNodeAEHook" inserts "maxwellShapeNodeAEHook" into $AEshapeHooks which is then called in "AEshapeTemplate".
AEshapeTemplate is called whenever an object needs to display it's attribute editor layout usually because a node has been selected.
I said
QUOTE
But since they are modifying not only the cameras (look at the switch statement) they go back an additional level so they probably end up modifying the showEditor.mel or s.th like that.
Actually AEshapeTemplate is one level before AEcameraTemplate, I was looking at AEshapeTemplate prior to posting the above, but since Joojaa was talking about some hooks being inserted I thought that it won't be the AEshapeTemplate but rather showEditor since that one is ultimately responsible for selecting the correct AE_Templates, you also might want to look at the file showEditor.mel to get an idea.
So really how maxwell renderer is included is not by hooks, since usually a hook is something that is added to extend the existing functionality, which is not the case in a replacement of the AEshapeTemplate, because it might be the case that some other 3rd party relies upon a modification of the AEshapeTemplate so either maxwell would override the other 3rd parties modification or the 3rd parties modification override maxwells modification. A hook would not lead to that behaviour, but both the 3rd party and maxwell would be called in the AEshapeTemplate in order of registration. So the advantage of the mental ray developers is that Autodesk ships mental rays modified AEcameraTemplate for them no matter what, which is ok because their 2 lines are minimally invasive and not likely to break things.