3dcheapskate opened this issue on May 22, 2012 ยท 10 posts
3dcheapskate posted Thu, 13 December 2012 at 10:18 PM
Advice Please!
I'm planning to move the data for figure matching, positioning/orienting the prop, and hand posing into an external file. Here's three code snippets from the relevant parts of my current PropGoto+ script showing how the data is currently hard-coded in the script:
Figure recognition:
# Simple list (tuple) of options for figure selection drop-down
optlist = ("Aiko 3","Antonia")
# Expanded list (tuple of tuples) for figure name matching
# The second,third, etc parameters in each inner tuple are the alternative CR2 filenames and figure names from within the CR2 - that's what I use to match figure.
optlist2 = (("Aiko 3","blAiko3"),("Antonia","Antonia"))
Prop translation/orientation parameters:
# Tuple of x,y,z rotations and translations to position the prop correctly in the right hand of the zeroed figure
elif action == optlist[0]: # Aiko 3 RH values
(yR,xR,zR,xT,yT,zT) = (-5.90536,0.929067,-102.083,-0.278811,0.544785,0.0365292)
elif action == optlist[1]: # Antonia RH values
(yR,xR,zR,xT,yT,zT) = (-47.868999,-8.78641,-97.023598,-0.267093,0.614172,0.045245)
Handgrip:
# aHR is a tuple of hand rotations, aKR is a tuple of tuples of knuckle rotations (five fingers, three knuckles per finger, three rotations per knuckle)
if action == optlist[0]: # Aiko 3 DhaGrip RH values
aHR = (0.647785,-8.1833,0.823158)
aKR = (((48,6.09101,1),(54.9843,-18.9889,-0.0454721),(-0.00697216,-38.0285,-0.40209)),((-15.1137,-11.0771,47.2888),(0,0,84),(0,0,29)),((-15.1075,0.0805138,65.969),(-0.0826297,0.0885081,61.9591),(-0.0392733,-0.0291215,47.426)),((-10.0911,5.37818,76.9863),(0,0.0285995,55),(-0.0134865,0.220874,48)),((-11.0294,3.9855,89.9653),(-0.0317562,-0.0216579,36.8822),(-0.0353459,-0.104162,33.2371)))
elif action == optlist[1]: # Antonia DhaGrip RH values
The source data for these arrays/tuples is currently in a spreadsheet. I have formulae in the spreadsheet to create the lines of code, and I cut-and-paste these into my scripts.
When I only had the PropGoto+ script and a single Smart+ prop (the original S.E.Asian sword), updating two files to add new figure support/improve the hand poses didn't seem to difficult. But I now have an additional three Smart+ props (S.E.Asian shields) and plans to create a lot more. Manually updating each file is less and less attractive!
An obvious solution is to put the data into an external file and to have the scripts populate the tuples from that file. I have my own thoughts about the file format and file parsing, but I'd really appreciate suggestions/recommendations/cautions before I start...
TIA!
The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.
*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).