Page 1 of 1

Attribute spread sheet and material matte overrides

Posted: Tue Jul 19, 2011 5:44 am
by r3dcube
Hey,

I'm not seeing anything in the attribute spread sheet for Maxwell but maybe I'm just missing it? If it's not would there be any chance of it being implemented in the future? Would be nice to quickly flip many attributes on and off quickly rather then doing it all manually.
I can't create layer overrides on the objects material matte, is this something that might be fixed in the future as well?

Cheers,
Bryan

Re: Attribute spread sheet and material matte overrides

Posted: Tue Jul 19, 2011 12:12 pm
by Mihnea Balta
Showing the Maxwell attributes in the spreadsheet is difficult. We may be able to do it from 2012 and up because they added support for custom attributes in the API, but it's unfeasible in earlier versions.

I'll look into the issue with overrides on material checkboxes, I think it's because of a limitation in the Maya UI API. I'll see if I can find a workaround.

Re: Attribute spread sheet and material matte overrides

Posted: Tue Jul 19, 2011 11:41 pm
by r3dcube
:D thanks for that

Re: Attribute spread sheet and material matte overrides

Posted: Sun Jul 15, 2012 10:23 am
by c.b.dardis@gmail.com
Hi first post, and I have to +1 this.

I have 100s of objects that need their motion blur override, no attribute spreadsheet for thing like this is a PITA :)

now we are in 2012, are you guys looking at this?

Thanks!

Chris.

*edit

ok so I thought that in the interim I will script around this, but;
Code: Select all
import pymel.core as pm

lsSel = pm.ls(geometry = True)

print len(lsSel)

for i in lsSel:
    i.mxMotionType.set (1) 
gave me;
Code: Select all
# Error: line 1: AttributeError: file C:\Program Files\Autodesk\Maya2012\Python\lib\site-packages\pymel\core\nodetypes.py line 321: nt.Mesh(u'Bubble01:BigBubbleShape') has no attribute or method named 'mxMotionType' # 
... then I read in the manual http://support.nextlimit.com/display/ma ... nder+Flags;
These attributes do not exist until you set them to a non-default value, to prevent cluttering up the scene.
doh.

Is there a way I can create this attribute on each object on my list, perhaps calling on the plugin's own api?

Thanks :D

Re: Attribute spread sheet and material matte overrides

Posted: Sun Jul 15, 2012 11:32 am
by c.b.dardis@gmail.com
OK, now in answer to my own question;
If you want to manipulate these attributes from script, you need to first ensure that they exist. The plug-in provides a function called maxwellSetCustomScalar which creates the attribute if needed and sets it to the specified value, so use that instead of calling setAttr directly:

maxwellSetCustomScalar("double", "cameraShape1", "mxFstop", 8.0);
maxwellSetCustomScalar("long", "cameraShape1", "mxIso", 200);

The first parameter specifies the type of the attribute. Valid values are "long" for integers and enums, "double" for floating point numbers and "bool" for booleans. The following parameters are the node name, attribute name and value. For the complete list of custom attribute names, see the file maxwellCustomAttrs.mel in the scripts/others subdirectory of the Maya installation path.
I will give this a shot...

*edit

ok, quickie to set all geo to static. Doesn't require much editing to change currently selected to - whatever. Posting here for posterity. Hasn't fixed my issues entirely though, as I want the character motion blurred but no the set (i.e. disable camera motion blur). Any suggestions?

anways, here is the code...
Code: Select all
import pymel.core as pm

lsSel = pm.ls(geometry = True)

print len(lsSel)

for i in lsSel:
    pm.mel.maxwellSetCustomScalar("long", str(i), "mxMotionType", 1)

Re: Attribute spread sheet and material matte overrides

Posted: Mon Jul 23, 2012 1:12 am
by r3dcube
Looks like that's working, here's the same thing but in mel which is the work around we've been using.
Code: Select all
string $sel[];
string $nodeType;
$sel= `ls -sl -dag -lf -type "mesh"`;
for($i=0;$i<size($sel);$i++)
{  
    if(objExists(     ($sel[$i]+".mxMotionType")))
	 {
       maxwellCustomScalarChanged "bool" ($sel[$i]+".mxMotionType");          
       setAttr  ($sel[$i]+".mxMotionType") 0;     
	 }
}
By switching the 0 and the 1 you can turn it on and off or use 2 and 3 for additional options.