Stop DX11shader adding all plugs from cbuffer

18 views
Skip to first unread message

thirstydevil

unread,
Jan 13, 2015, 7:47:15 AM1/13/15
to python_in...@googlegroups.com
Maya's DX11Shader adds a plug for every attribute it finds it the FX file.  This is fine as I hide them with the correct semantic but I can't get the plugin to ignore them completely and not add the plugs to the node.  The plugs are making their way into the FBX which is messing things up on our FBX translator for game.  One solution is to not output cbuffers but it would mean more work as we can easily add the sematics to the attribute.

For example:

cbuffer LightInfo {
float4 m_afLightPositionX[ 1 ] < string UIWidget = "None"; >;
float4 m_afLightPositionY[ 1 ] < string UIWidget = "None"; >;
float4 m_afLightPositionZ[ 1 ] < string UIWidget = "None"; >;
float4 m_afLightAttenuationX < string UIWidget = "None"; >; 
float4 m_afLightAttenuationY < string UIWidget = "None"; >; 
float4 m_afLightAttenuationZ < string UIWidget = "None"; >; 
float4 m_afLightColour[ 4*1 ] < string UIWidget = "None"; >;
float4 m_afSpecularMask < string UIWidget = "None"; >; 
float4 m_AnisotropicDirection < string UIWidget = "None"; >;
float4 m_vConeMultiplier < string UIWidget = "None"; >; 
float4 m_vConeAdder < string UIWidget = "None"; >; 
float4 m_vLightDirection1 < string UIWidget = "None"; >; 
float4 m_vLightDirection2 < string UIWidget = "None"; >; 
float4 m_vLightDirection3 < string UIWidget = "None"; >; 
float4 m_vLightDirection4 < string UIWidget = "None"; >; 
};

I've also got the source code up and running hoping to compile it, but I can't get it to compile on WIndow7 because of a linker error.  Error 7 error LNK1104: cannot open file 'D3DX11Effects.lib' C:\Program Files\Autodesk\Maya2014\devkit\plug-ins\dx11Shader\LINK dx11Shader
I have installed the DX11 SDK and setup the correct environment variables used by the linker.

Any ideas?

Thanks


David Moulder

unread,
Jan 13, 2015, 11:29:43 AM1/13/15
to python_inside_maya
Problem solved....

Managed to find this


It seems there is a known issue compiling the DX11Shader plugin.  This project fixed my compile problems and I was able to filter out the global FX variables by a new semantic that didn't add the vars to the node.  However if anyone is doing this another way I'd be interested.  It seems silly to maintain a completely new version of the plugin to simple stop Maya adding all global variables found as plugs.  string UIWidget = "None" only hides them in the AETemplate code.  So I've added a string AsInternal = "" semantic for now that stops the attrib being added and is only computed in the FX file.  Maya doesn't need to know about them, nor do they need to get into FBX.

Thanks. 

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/a2d6e240-8a24-4087-9d65-adf52b52e7ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages