Creating Assets with set driven key


#1

Hello,

I ran in to a big problem and it’s related to creating assets of an object that has extra atributes on it. And those atributes have setdriven keys bound to it.
I’ll show you what i do and maybe you know what goes wrong… or is this a bug?

[ol]
[li]I just start making a nurbs curve and a sphere.[/li][li]put them next to eachother and freeze there transformations.[/li][li]I select the curve and add an atribute[/li][li][/li][li] My minimum and max are -75 to 75[/li][li]when i added the atribute i make a setdriven key[/li][li]The curve is the driver and the sphere is the driven object[/li][li][/li][li]I use the added atribute as the driver atribute and translate Y of the spere as the driven atribute.[/li][li]Nothing special here…[/li][li]i just move the spere up when TEST is on -75 and press key[/li][li]And i move the spere down and put TEST on 75 and press key[/li][li]So now my set driven key is made… when i change the value of TEST the Spere moves up and down.[/li][li]Now i go to Assets (in animation)-> advanced asset and create hotbox[/li][li][/li][li]then i choose these settings:[/li][li][/li][li]now I select the circle and go to my channal box, there i select TEST and go to EDIT-> Publish to Asset hotbox[/li][li][/li][li]and i use these settings[/li][li][/li][li]Now when i go to the Atribute editor and select the first tab. (test_asset) now there is a published atribute only if you look closely… it goes to -25 to 25… but the atribute i made went from -75 to 75.[/li][li]Please help me i want to have the slider go to -75 to 75.[/li][li]I noticed that when i use an existing atribute( like translate rotate or scale) the slider goes to -100 to 100[/li][li][/li][/ol]Sorry for the long post but i hope this makes it more clear where the problem is…


#2

I think lines 1069 & 1070 of AEcontainerMain.mel (scripts/AETemplates) are messing with you.

You can load the script into the Script Editor, change those values and re-run to get a full range in the Attribute Editor :slight_smile:


#3

YES!

I found the part where you where talking about, but now the next thing.
i have sh*t load of values that need to be filled in so is it possible to get the values from the Driver of the set driven key?
So it automaticly fills in the -75 and 75?

Im not good with MEL but it have to do something with a getAtr i think, and maybe with the extra atributes of the object with the driver.


#4

Where do you want it to fill in the values?

You can use attributeQuery to get the min/max of an attr:

//Rough example
$min = `attributeQuery -node "nurbsCircle1.TEMP" -min "TEMP"`;
$max = `attributeQuery -node "nurbsCircle1.TEMP" -max "TEMP"`;

#5
string $attrShortNames[] = `listAttr -shortNames $attr`;
 string $attrShortName = ($node+"."+$attrShortNames[0]);

 
 float $min = `attributeQuery -node "nurbsCircle1.TEMP" -min "TEMP"`;
 float $max = `attributeQuery -node "nurbsCircle1.TEMP" -max "TEMP"`;
 
string $pNode = plugNode($publishee);
 string $pAttr = plugAttrNoIndex($publishee);
 if (`attributeQuery -node $pNode -softMinExists $pAttr`) {
  float $smin[] = `attributeQuery -node $pNode -softMin $pAttr`;
  $min = $smin[0];
 }
 if (`attributeQuery -node $pNode -softMaxExists $pAttr`) {
  float $smax[] = `attributeQuery -node $pNode -softMax $pAttr`;
  $max = $smax[0];

This is what i have now but im thinking that it is maybe impossible.
Because all the objects in my scene have ofcourse different names this should mean i need to replace the name nurbsCircle1.TEMP everytime with the name of the object with the driven key.
So the name of the object and the atribute will be different.
Or the code need to be someting with: look at selected object and the selected atribute and take that min and max

When I just change the -25 25 to -75 75 then all the other atributes that go to a different range will also go to -75 75 and i still have the same problem.

I just want Maya to make the range slider to the given Driver info of the added atribute.


#6

Not much is impossible, just awkward :slight_smile:

How about selecting all objects and capturing the selection into a list, then you could loop over the array the work through the different names:

//more rough MEL
 string $myListOfSelectedObjects[] = `ls -sl`;

Then you could make a loop that went through this list, $myListOfSelectedObjects[n], and did to each what you wanted.