PDA

View Full Version : Is there a tool/script that....


FluidEdge
10-26-2010, 03:46 PM
that allows you to enter a range of values for an attribute then playblast/cache for each variation based on those values so you can quickly see what value for your attribute works best?

If there is no tool for this available, can anyone give me some hints as to how to begin making one? I'm up for making a fairly involved, comprehensive tool.

surreal-reality
10-26-2010, 06:12 PM
Would this tool need to allow custom addition of random or user selected attributes?

I think this wouldn't be too troublesome to achieve though.
I'm thinking out loud here, but if you wrote a function to grab, or at least let a user input all the different attributes, you could loop through all of these.
For instance, you could have a text scroll list display the attributes of say a cube, and then have a second scroll list that you add selected attributes too.

Then next, you need a step value, or an amount to increase each attribute by each time it repeats. If this was the same across the board, you could simply query a float field for a user inputted value, if you wanted to get fancy though, one could attach this value, or step to each attribute you add.
For example, a list of attributes might look like this:
["obj1.asd", "obj1.qwe", "obj1.zxc"]
You could instead have your gui / scroll list combo with a float field create something like this:
[("obj1.asd", 1.0), ("obj1.qwe", .2), ("obj1.zxc", .15)]

*(you could make each smaller list have 4 items, a start and stop value for each attribute too)

the tricky part would be making it properly count with any number of attributes, and different step sizes. Think of a clock though, hours, minutes and seconds.
Every time we pass 60 seconds, we add a minute, every time we add 60 minutes, we add an hour.

I would have to think about the part involving counting, but maybe that's enough to get some ideas going around.

FluidEdge
10-26-2010, 08:09 PM
really interesting ideas. I think i'll look at this over the weekend!

thanks!

surreal-reality
10-26-2010, 09:21 PM
cool, let us know if you come up with anything!
I took a quick stab at the counting idea, and hit a few road blocks, I'll try some more later this week or tonight and let you know if I come up with anything.

surreal-reality
10-27-2010, 04:57 PM
ok, so I have had some luck. What I wrote up last night is geared more towards multiple attributes, and a consistent "step" size and a start and stop number for each attribute.

An option to specify specific values would probably be beneficial too, so I'll mess with that next and see about a gui for it.

just copyPaste and run, it just prints it's current combination of values, but the print statement could easily be swapped out for a function such a playblast command that labels the playblast based on the current attribute values.


#("attributeName", step, start, stop)
asd = [["pCube2.translateX", 1, 0, 10], ["pCube2.translateY", 2, 0, 10], ["pCube2.translateZ", 1, 0, 5], ["pCube2.somethingElse", .2, 0, 1]]
originalLen = len(asd)
origAsd = asd
backupAsd = []
whereAreWeStr = "Currently at : "
for item in asd:
backupAsd.append(item[2])
#This var tells the script whether or not to continue iterating on the same attribute, or to move to the next one.
amIfinished = 0
numOfAttr = range(len(asd))
curAttr = len(asd) - 1
#print numOfAttr
#print curAttr

while(amIfinished == 0):
for item in asd:
whereAreWeStr = whereAreWeStr + str(item[2]) + " : "
print whereAreWeStr
whereAreWeStr = "Currently at : "
if(originalLen == 1):
if((asd[numOfAttr[curAttr]][2] + asd[numOfAttr[curAttr]][1]) <= origAsd[numOfAttr[curAttr]][3]):
#print str(asd[numOfAttr[curAttr]][2]) + " of " + str(asd[numOfAttr[curAttr]][0])
asd[numOfAttr[curAttr]][2] = asd[numOfAttr[curAttr]][2] + asd[numOfAttr[curAttr]][1]
else:
amIfinished = 1
elif(curAttr == (len(asd) - 1)):
if((asd[numOfAttr[curAttr]][2] + asd[numOfAttr[curAttr]][1]) <= origAsd[numOfAttr[curAttr]][3]):
#print str(asd[numOfAttr[curAttr]][2]) + " of " + str(asd[numOfAttr[curAttr]][0])
asd[numOfAttr[curAttr]][2] = asd[numOfAttr[curAttr]][2] + asd[numOfAttr[curAttr]][1]
else:
asd[numOfAttr[curAttr]][2] = backupAsd[curAttr]
curAttr = curAttr - 1
elif(curAttr < (len(asd) - 1) and curAttr > 0):
#print str(asd[numOfAttr[curAttr]][2]) + " of " + str(asd[numOfAttr[curAttr]][0])
if((asd[numOfAttr[curAttr]][2] + asd[numOfAttr[curAttr]][1]) <= origAsd[numOfAttr[curAttr]][3]):
asd[numOfAttr[curAttr]][2] = asd[numOfAttr[curAttr]][2] + asd[numOfAttr[curAttr]][1]
curAttr = curAttr + 1
else:
asd[numOfAttr[curAttr]][2] = backupAsd[curAttr]
curAttr = curAttr - 1
elif(curAttr <= 0):
#print str(asd[numOfAttr[curAttr]][2]) + " of " + str(asd[numOfAttr[curAttr]][0])
if((asd[numOfAttr[curAttr]][2] + asd[numOfAttr[curAttr]][1]) <= origAsd[numOfAttr[curAttr]][3]):
asd[numOfAttr[curAttr]][2] = asd[numOfAttr[curAttr]][2] + asd[numOfAttr[curAttr]][1]
curAttr = len(asd) - 1
else:
amIfinished = 1


print "Finished"

CGTalk Moderation
10-27-2010, 04:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.