Skip to content

Instantly share code, notes, and snippets.

@zenopelgrims
Last active June 4, 2024 05:47
Show Gist options
  • Save zenopelgrims/9103889 to your computer and use it in GitHub Desktop.
Save zenopelgrims/9103889 to your computer and use it in GitHub Desktop.
It makes stuff wet
# import modules
import maya.cmds as cmds
import maya.OpenMaya as OM
import random
import math
# user interface
class windowUI():
def __init__(self, *args):
if cmds.window("windowUI", exists=True):
cmds.deleteUI("windowUI")
cmds.window("windowUI", title = "Water Droplet Generator v0.1", resizeToFitChildren = True, sizeable = False)
# base object layout
cmds.frameLayout(label = "General", collapsable=False, mw = 5, mh = 5)
cmds.rowColumnLayout(nc=3, cal=[(1,"right")], cw=[(1,80),(2,200),(3,95)])
cmds.text(l="Base Object: ")
cmds.textField("baseObject")
cmds.button("baseObjectButton", l="Select", c=self.selectBaseObject)
cmds.setParent("..")
cmds.separator(h=10, st='in')
# density
cmds.rowColumnLayout(w=380)
cmds.intSliderGrp("dropDensity", l="Density: ", v=1200, cw3=[80,40,200], min=1, max=2500, fmx=10000, f=True)
# minDropSize
cmds.rowColumnLayout(w=380)
cmds.floatSliderGrp("minDropSize", l="Minimum Size: ", v=0.02, cw3=[80,40,200], min=0.01, max=0.1, fmx=1, f=True, pre = 2)
# maxDropSize
cmds.rowColumnLayout(w=380)
cmds.floatSliderGrp("maxDropSize", l="Maximum Size: ", v=0.35, cw3=[80,40,200], min=0.1, max=1, fmx=10, f=True, pre = 2)
cmds.separator(h=10, st='in')
# randomness
cmds.rowColumnLayout(w=380)
cmds.checkBox("optCheckBox", l = 'Use an optimised randomness combination (recommended)', value = True, onc="cmds.intSliderGrp('randomness', e=True, en=False)", ofc="cmds.intSliderGrp('randomness', e=True, en=True)")
cmds.intSliderGrp("randomness", l="Randomness: ", v=8, cw3=[80,40,230], min=1, max=8, fmx=10, f=True, enable = False)
cmds.separator(h=10, st='in')
cmds.rowColumnLayout(w=380)
cmds.checkBox("smoothCheckBox", l = 'Smooth preview the waterdrops', value = True)
cmds.separator(h=10, st='in')
# check buttons
cmds.rowColumnLayout(nc=2, cal=[(1,"right")], cw=[(1,185),(2,185)])
cmds.button("checkMeshButton", l="Check Mesh", al="center", c=self.checkMesh)
cmds.button("subDMeshButton", l="Subdivide Mesh", al="center", c = self.subDMesh)
cmds.setParent("..")
cmds.separator(h=10, st='in')
# generate button
cmds.button("generateButton", l="Make it rain baby", w=370, h = 40, al="center", c=self.waterDrops)
cmds.button("resetButton", l="Reset to default values", w=370, al="center", c=self.__init__)
cmds.text(l = '', w = 370, h = 10, ww=True)
cmds.text(l = 'Please bear in mind that the default size values are physically accurate when your object is correctly scaled to real world units.', w = 370, h = 30, ww=True)
cmds.text(l = 'The algorithm works best on objects with evenly spaced topology.', w = 370, h = 30, ww=True)
cmds.text(l = 'Zeno Pelgrims - www.graffik.be - NCCA 2014', w = 370, h = 30, ww=True, fn = "smallPlainLabelFont")
cmds.showWindow("windowUI")
# selectBaseObject Function
def selectBaseObject(self, *args):
selectedObject = cmds.ls(sl=True, tr=True)
if len(selectedObject) > 1 or len(selectedObject) == 0:
cmds.textField("baseObject", e=True, tx="Please select only one object")
else:
self.baseObject = selectedObject[0]
cmds.textField("baseObject", e=True, tx=self.baseObject)
# Check Mesh Function
def checkMesh(self, *args):
# variables
dropDensity = cmds.intSliderGrp("dropDensity", query = True, v = True)
# get the amount of vertices of the object
cmds.select(self.baseObject)
selectedVertexNumberList = []
selectedVertexNumber = cmds.polyEvaluate(vertex = True)
selectedVertexNumberList.append(selectedVertexNumber)
vertexIndexList = [v for v in range(selectedVertexNumber)]
if dropDensity < len(vertexIndexList):
OM.MGlobal.displayInfo("Your mesh is good to go!")
else:
OM.MGlobal.displayError("The mesh is not dense enough to make %d drops! Use the subdivide mesh function!"%dropDensity)
return
# subDMesh Function
def subDMesh(self, *args):
cmds.select(self.baseObject)
global subDObject
subDObject = cmds.duplicate(self.baseObject, name = "subDProxy")
dropDensity = cmds.intSliderGrp("dropDensity", query = True, v = True)
# get the amount of vertices of the object
faceSelection = cmds.select(self.baseObject)
selectedFacesNumberList = []
selectedFacesNumber = cmds.polyEvaluate(face = True)
selectedFacesNumberList.append(selectedFacesNumber)
facesIndexList = [v for v in range(selectedFacesNumber)]
amountOfTimes = math.ceil(math.sqrt(math.sqrt(dropDensity/len(facesIndexList))))
cmds.polySubdivideFacet("subDProxy", divisions = amountOfTimes, m = False, ch = False)
cmds.select( clear=True )
OM.MGlobal.displayInfo("Your mesh is now good to go!")
# main script
def waterDrops(self, *args):
# variables
dropDensity = cmds.intSliderGrp("dropDensity", query = True, v = True)
minDropSize = cmds.floatSliderGrp("minDropSize", query = True, v = True)
maxDropSize = cmds.floatSliderGrp("maxDropSize", query = True, v = True)
randomness = cmds.intSliderGrp("randomness", query = True, v = True)
optRandCheckBox = cmds.checkBox("optCheckBox", query = True, v = True)
smoothCheckBox = cmds.checkBox('smoothCheckBox', query = True, v = True)
counter = 0
if cmds.objExists("subDProxy") == True:
selectedObject = subDObject[0]
else:
selectedObject = self.baseObject
# check if something is selected
if self.baseObject == None:
OM.MGlobal.displayError("Please make sure source and target(s) are selected above.")
return
cmds.select(selectedObject)
# get the amount of vertices of the object
selectedVertexNumberList = []
selectedVertexNumber = cmds.polyEvaluate(vertex = True)
selectedVertexNumberList.append(selectedVertexNumber)
vertexIndexList = [v for v in range(selectedVertexNumber)]
# sample random vertices
randomVertIndexList = random.sample(vertexIndexList, dropDensity)
for i in range(dropDensity):
# assign random vertex from pre-sampled vertices list to variable
randomVertex = random.choice(randomVertIndexList)
# remove the last used vertex from the list
randomVertIndexList.remove(randomVertex)
# assign the vertex position to variable
newPosition = cmds.pointPosition("%s.vtx[%d]"%(selectedObject,randomVertex))
# generate randomDropSize
randomDropSize = random.uniform(minDropSize,maxDropSize)
# select the vertex
cmds.select("%s.vtx[%d]"%(selectedObject,randomVertex))
# grow the selection
cmds.GrowPolygonSelectionRegion()
# remove original vertex from selection
cmds.select("%s.vtx[%d]"%(selectedObject,randomVertex), toggle = True)
# assign selection to variable
surroundingVertices = cmds.ls(selection = True)
# for every entry in surroundingVertices
for v in surroundingVertices:
# select original vertex
cmds.select("%s.vtx[%d]"%(selectedObject,randomVertex))
# write the worldspace position to a var
worldSpacePositionA = cmds.xform(query = True, worldSpace = True, translation = True)
# sample a random surrounding vertex
randomSurroundingVertex = random.choice(surroundingVertices)
# remove the sampled vertex from the list
surroundingVertices.remove(randomSurroundingVertex)
# select the random vertex
cmds.select(randomSurroundingVertex, r=True)
# write the worldspace position to a var
worldSpacePositionB = cmds.xform(query = True, worldSpace = True, translation = True)
# find the distance
distanceX = worldSpacePositionA[0] - worldSpacePositionB[0]
distanceY = worldSpacePositionA[1] - worldSpacePositionB[1]
distanceZ = worldSpacePositionA[2] - worldSpacePositionB[2]
distance = math.sqrt(distanceX*distanceX + distanceY*distanceY + distanceZ*distanceZ)
cmds.select(clear = True)
# Do something with the waterdrop
if (randomDropSize) < distance:
# make the polycube & delete backfaces
newWaterDrop = cmds.polyCube(name="waterDrop")
if smoothCheckBox == True:
cmds.displaySmoothness( polygonObject=3 )
cmds.polySmooth(newWaterDrop, divisions = 2)
cmds.select(".f[8:9]", ".f[12]", ".f[15]",".f[24:25]", ".f[28]", ".f[31]", ".f[40:41]", ".f[44]",".f[47]",".f[56:57]",".f[60]",".f[63]",".f[80:95]")
cmds.delete()
# vertex coordinates of the premade drops
preMadeDrop_1 = [[0.09476800262928009, -0.23948000371456146, 0.22791500389575958], [0.015838999301195145, 0.2482910007238388, 0.16062000393867493], [-0.014693999662995338, 0.2203730046749115, -0.11251699924468994], [0.08966100215911865, -0.2363079935312271, -0.22987399995326996], [-0.05143899843096733, -0.3042280077934265, 0.2856990098953247], [-0.10862000286579132, 0.2973020076751709, 0.19849500060081482], [-0.10594800114631653, 0.2799069881439209, -0.16680499911308289], [-0.0478690005838871, -0.3013780117034912, -0.29732999205589294], [0.09060599654912949, 0.024872999638319016, 0.22475600242614746], [0.0190459992736578, 0.2965799868106842, 0.011713000014424324], [0.05259399861097336, 0.007323999889194965, -0.18831199407577515], [0.14838500320911407, -0.31064799427986145, -0.013996000401675701], [-0.07202199846506119, 0.010369000025093555, 0.30070599913597107], [-0.12072700262069702, 0.42917901277542114, 0.006018000189214945], [-0.08397799730300903, -0.0006890000076964498, -0.28531700372695923], [-0.032058000564575195, -0.42917901277542114, -0.010258999653160572], [0.1661520004272461, 0.0341619998216629, -0.012961000204086304], [-0.12964299321174622, -0.28445500135421753, 0.2647390067577362], [0.032823000103235245, -0.27649399638175964, 0.26331600546836853], [-0.1681230068206787, 0.27759599685668945, 0.19921299815177917], [-0.039473000913858414, 0.27831199765205383, 0.1800519973039627], [-0.15210600197315216, 0.2601810097694397, -0.15951800346374512], [-0.056067999452352524, 0.25579699873924255, -0.14016200602054596], [-0.12261299788951874, -0.28445300459861755, -0.2733849883079529], [0.03184400126338005, -0.27744099497795105, -0.2742980122566223], [0.10319499671459198, -0.12483300268650055, 0.24022500216960907], [0.05632200092077255, 0.15978099405765533, 0.19132100045681], [0.02488500066101551, 0.28859999775886536, 0.0985959991812706], [0.0001449999981559813, 0.26484599709510803, -0.06360000371932983], [0.016011999920010567, 0.13082000613212585, -0.1411920040845871], [0.08112700283527374, -0.12550599873065948, -0.22817200422286987], [0.1293729990720749, -0.28209200501441956, -0.15484200417995453], [0.12922699749469757, -0.2878600060939789, 0.13766099512577057], [-0.060906000435352325, -0.15491099655628204, 0.32797300815582275], [0.013016999699175358, 0.016925999894738197, 0.27718400955200195], [-0.08870299905538559, 0.16344000399112701, 0.25252199172973633], [-0.15238800644874573, 0.006260999944061041, 0.2904829978942871], [-0.11898999661207199, 0.3986150026321411, 0.11860000342130661], [-0.051426000893116, 0.38371801376342773, 0.00976799987256527], [-0.11749400198459625, 0.3791179955005646, -0.09433300048112869], [-0.1905589997768402, 0.39701101183891296, 0.003512999974191189], [-0.09430199861526489, 0.1471710056066513, -0.22346200048923492], [-0.015052000060677528, 0.0008590000215917826, -0.24667799472808838], [-0.06440199911594391, -0.16104499995708466, -0.32797300815582275], [-0.14219999313354492, -0.0007489999989047647, -0.2662990093231201], [-0.03696899861097336, -0.39747199416160583, -0.1789110004901886], [0.06508000195026398, -0.4009679853916168, -0.013403999619185925], [-0.038270000368356705, -0.3956480026245117, 0.1602730005979538], [-0.12610700726509094, -0.39739900827407837, -0.010273000225424767], [0.1905589997768402, -0.14773300290107727, -0.01838899962604046], [0.1159219965338707, 0.01839900016784668, -0.11158899962902069], [0.0979589968919754, 0.18088799715042114, 0.0013559999642893672], [0.15048199892044067, 0.03564999997615814, 0.1279810070991516], [0.0258799996227026, -0.13740099966526031, 0.2980259954929352], [-0.011952999979257584, 0.15999899804592133, 0.2321850061416626], [-0.15717799961566925, 0.15235799551010132, 0.2505509853363037], [-0.14450299739837646, -0.14923299849033356, 0.30564698576927185], [-0.046751998364925385, 0.3610599935054779, 0.10593800246715546], [-0.05886700004339218, 0.3410550057888031, -0.07620099931955338], [-0.1741819977760315, 0.3547379970550537, -0.09427200257778168], [-0.1835229992866516, 0.3688820004463196, 0.12256400287151337],[-0.0391089990735054, 0.13609099388122559, -0.190187007188797], [0.011432000435888767, -0.14721199870109558, -0.29337701201438904], [-0.13486899435520172, -0.15268899500370026, -0.30205100774765015],[-0.14307600259780884, 0.1375270038843155, -0.21019400656223297], [0.05438999831676483, -0.36869001388549805, -0.16902300715446472], [0.0521479994058609, -0.3693990111351013, 0.14995799958705902], [-0.12543100118637085, -0.36871200799942017, 0.14748699963092804], [-0.12227900326251984, -0.36917299032211304, -0.164559006690979], [0.14758600294589996, -0.13297900557518005, -0.14530299603939056], [0.06284099817276001, 0.15252099931240082, -0.07630100101232529], [0.1003670021891594, 0.18081499636173248, 0.10996100306510925], [0.16780400276184082, -0.1387539952993393, 0.13657599687576294]]
preMadeDrop_2 = [[0.1191829964518547, -0.24932999908924103, 0.23644399642944336],[0.09057500213384628, 0.28369900584220886, 0.2800619900226593],[0.019805999472737312, 0.23739199340343475, -0.13598200678825378],[0.0524430014193058, -0.20990200340747833, -0.3605560064315796], [-0.019406000152230263, -0.2908869981765747, 0.3111580014228821], [-0.023679999634623528, 0.3320179879665375, 0.36682501435279846], [-0.06963899731636047, 0.2843089997768402, -0.1486469954252243], [-0.09027499705553055, -0.30298399925231934, -0.42092999815940857], [0.13470900058746338, 0.035652000457048416, 0.30322200059890747], [0.07513599842786789, 0.30956900119781494, 0.04182099923491478], [0.03895200043916702, 0.04783499985933304, -0.2610740065574646], [0.12505699694156647, -0.28293299674987793, -0.09037300199270248], [-0.010482000187039375, 0.026341000571846962, 0.450749009847641], [-0.045054998248815536, 0.4246549904346466, 0.08417099714279175], [-0.0929810032248497, 0.04719100147485733, -0.35423898696899414], [-0.04380499944090843, -0.4246549904346466, -0.05016700178384781], [0.14657799899578094, 0.059296999126672745, -0.03189000114798546], [-0.09549400210380554, -0.2662689983844757, 0.30532801151275635], [0.06054000183939934, -0.28446200489997864, 0.2847220003604889], [-0.09688500314950943, 0.31742599606513977, 0.3750689923763275], [0.044815998524427414, 0.3151170015335083, 0.3309049904346466], [-0.12399499863386154, 0.2814500033855438, -0.13262499868869781], [-0.017263999208807945, 0.26452600955963135, -0.14720399677753448], [-0.16531099379062653, -0.27219799160957336, -0.36041900515556335], [-0.006428999826312065, -0.26738598942756653, -0.4069159924983978], [0.13774800300598145, -0.12494300305843353, 0.2772819995880127], [0.11510699987411499, 0.18331100046634674, 0.30153200030326843], [0.09290900081396103, 0.30887898802757263, 0.1758500039577484], [0.045375000685453415, 0.2762010097503662, -0.06954599916934967], [0.028189999982714653, 0.15974999964237213, -0.18221800029277802], [0.049908000975847244, -0.08438999950885773, -0.33802399039268494], [0.0919869989156723, -0.25339698791503906, -0.25971901416778564], [0.1349949985742569, -0.2809549868106842, 0.0959630012512207], [-0.01082600001245737, -0.14902499318122864, 0.41242098808288574], [0.06969299912452698, 0.02706499956548214, 0.4045659899711609], [-0.015021000057458878, 0.19609999656677246, 0.4332909882068634], [-0.09489600360393524, 0.025575000792741776, 0.4362429976463318], [-0.03135799989104271, 0.4198949933052063, 0.23547999560832977], [0.021491000428795815, 0.39055201411247253, 0.06669300049543381], [-0.05827699974179268, 0.3669709861278534, -0.04620499908924103], [-0.1192220002412796, 0.4023680090904236, 0.10571800172328949], [-0.07876700162887573, 0.18016499280929565, -0.23932099342346191], [-0.02369300089776516, 0.045719001442193985, -0.32450300455093384], [-0.1001800000667572, -0.14028899371623993, -0.450749009847641], [-0.1565680056810379, 0.055674999952316284, -0.30760300159454346], [-0.0655440017580986, -0.4077030122280121, -0.266090989112854], [0.048944998532533646, -0.3930889964103699, -0.07640299946069717], [-0.02907700091600418, -0.38051798939704895, 0.15393699705600739], [-0.13214899599552155, -0.373212993144989, -0.01450899988412857], [0.15752500295639038, -0.11017599701881409, -0.07617799937725067], [0.09765899926424026, 0.055240001529455185, -0.16868199408054352], [0.11576099693775177, 0.19881199300289154, 0.011354000307619572], [0.16478100419044495, 0.05015600100159645, 0.14801500737667084], [0.07169699668884277, -0.14225199818611145, 0.37152400612831116], [0.0574520006775856, 0.18668699264526367, 0.3904690146446228], [-0.09446699917316437, 0.18250000476837158, 0.428943008184433], [-0.09248100221157074, -0.13954299688339233, 0.39694198966026306], [0.03856600075960159, 0.3798780143260956, 0.20489199459552765], [-0.0005510000046342611, 0.3413439989089966, -0.05559999868273735], [-0.1215289980173111, 0.3514710068702698, -0.028307000175118446], [-0.10770899802446365, 0.4010060131549835, 0.2625179886817932], [-0.021995000541210175, 0.16623300313949585, -0.2252420037984848], [-0.02046000026166439, -0.11122900247573853, -0.4169810116291046], [-0.17197300493717194, -0.11545500159263611, -0.391416996717453], [-0.1338289976119995, 0.1816989928483963, -0.20864300429821014], [0.026770999655127525, -0.363088995218277, -0.27686598896980286], [0.057082001119852066, -0.3636449873447418, 0.12629500031471252], [-0.11057499796152115, -0.3412109911441803, 0.16206799447536469], [-0.15211600065231323, -0.3679549992084503, -0.2202340066432953], [0.10988199710845947, -0.09382399916648865, -0.2307099997997284], [0.07428599894046783, 0.17820599675178528, -0.10593400150537491],[0.13614900410175323, 0.19882799685001373, 0.1638289988040924], [0.17197300493717194, -0.1227250024676323, 0.1112930029630661]]
preMadeDrop_3 = [[0.10273099690675735, -0.16375599801540375, 0.20751400291919708], [0.028279999271035194, 0.19154800474643707, 0.08074299991130829], [-0.019067000597715378, 0.18945099413394928, -0.16056300699710846], [0.09288299828767776, -0.1649239957332611, -0.24421900510787964], [-0.03955499827861786, -0.2339629977941513, 0.3213840126991272], [-0.08235199749469757, 0.26061201095581055, 0.1537330001592636], [-0.0947910025715828, 0.26637500524520874, -0.20488500595092773], [-0.03530599921941757, -0.24057400226593018, -0.310030996799469], [0.09295099973678589, 0.014871999621391296, 0.16851599514484406], [0.033355001360177994, 0.24620400369167328, -0.042732998728752136], [0.03848399966955185, 0.022933999076485634, -0.22968600690364838], [0.1429159939289093, -0.22195599973201752, -0.025803999975323677], [-0.06466499716043472, 0.030837999656796455, 0.2997339963912964], [-0.08539500087499619, 0.35583600401878357, -0.020037999376654625], [-0.07982199639081955, 0.04321499913930893, -0.32183998823165894], [-0.018626000732183456, -0.35583600401878357, 0.0016479999758303165], [0.11911600083112717, 0.020191000774502754, -0.04610000178217888], [-0.11808999627828598, -0.21348899602890015, 0.3002380132675171], [0.04544699937105179, -0.2083200067281723, 0.28022998571395874], [-0.1466429978609085, 0.24840599298477173, 0.15317000448703766], [-0.013168999925255775, 0.23875699937343597, 0.12203600257635117], [-0.13267900049686432, 0.2510550022125244, -0.1901410073041916], [-0.050383999943733215, 0.23875899612903595, -0.18733100593090057], [-0.10749399662017822, -0.2191540002822876, -0.28237399458885193], [0.043515998870134354, -0.2135400027036667, -0.2907310128211975], [0.11141099780797958, -0.0817980021238327, 0.20783700048923492], [0.0538019984960556, 0.11116699874401093, 0.11376799643039703], [0.041788000613451004, 0.22958099842071533, 0.02520100027322769], [0.0033660000190138817, 0.22325700521469116, -0.10793600231409073], [-0.0015089999651536345, 0.1127299964427948, -0.1888909935951233], [0.08232799917459488, -0.07602299749851227, -0.2579509913921356], [0.12828999757766724, -0.2045229971408844, -0.1601639986038208], [0.1302330046892166, -0.20133399963378906, 0.11535599827766418], [-0.050280001014471054, -0.09749999642372131, 0.35565900802612305], [0.026203999295830727, 0.020942000672221184, 0.2549999952316284], [-0.0790179967880249, 0.1520169973373413, 0.22372500598430634], [-0.15135499835014343, 0.03736000135540962, 0.2895669937133789], [-0.0799660012125969, 0.33323898911476135, 0.07212600111961365], [-0.01768600009381771, 0.32577401399612427, -0.030462000519037247], [-0.09559299796819687, 0.33064699172973633, -0.11855299770832062], [-0.1541289985179901, 0.33719000220298767, -0.01169500034302473], [-0.09084200114011765, 0.1610489934682846, -0.2679100036621094], [-0.018610000610351562, 0.03490699827671051, -0.29767701029777527], [-0.05438400059938431, -0.096281997859478, -0.35565900802612305], [-0.13120099902153015, 0.04437899962067604, -0.2987239956855774], [-0.024197999387979507, -0.32743901014328003, -0.17799800634384155], [0.07627800107002258, -0.3190059959888458, -0.011238000355660915], [-0.0255110003054142, -0.32481899857521057, 0.18492500483989716], [-0.11244799941778183, -0.3285059928894043, 0.005303000099956989], [0.1541289985179901, -0.09292499721050262, -0.03768400102853775], [0.0835530012845993, 0.019625000655651093, -0.13908599317073822], [0.06648799777030945, 0.12770600616931915, -0.04871699959039688], [0.12305399775505066, 0.017743999138474464, 0.05722599849104881], [0.03901899978518486, -0.09023500233888626, 0.30838799476623535], [-0.0017350000562146306, 0.12829400599002838, 0.18300999701023102], [-0.15242600440979004, 0.1542920023202896, 0.22214999794960022], [-0.13494600355625153, -0.08697199821472168, 0.332055002450943], [-0.009468999691307545, 0.30483099818229675, 0.04849199950695038], [-0.03873400017619133, 0.30035400390625, -0.11280500143766403], [-0.14633800089359283, 0.3121120035648346, -0.10707999765872955], [-0.14839200675487518, 0.31514400243759155, 0.07756000012159348], [-0.04534099996089935, 0.1376270055770874, -0.24447999894618988], [0.01923700049519539, -0.08433900028467178, -0.330469012260437], [-0.12081199884414673, -0.08647800236940384, -0.32373499870300293], [-0.12884099781513214, 0.15536600351333618, -0.2504569888114929], [0.06498900055885315, -0.2945629954338074, -0.17082099616527557], [0.06411000341176987, -0.2897999882698059, 0.15712599456310272], [-0.1123649999499321, -0.29844599962234497, 0.1758970022201538], [-0.10765399783849716, -0.3008899986743927, -0.1613840013742447], [0.1303199976682663, -0.08388400077819824, -0.1552630066871643], [0.03604400157928467, 0.11554799973964691, -0.11860600113868713], [0.07721400260925293, 0.11916100233793259, 0.028170999139547348], [0.14513400197029114, -0.08697199821472168, 0.08654099702835083]]
preMadeDrop_4 = [[0.17758700251579285, -0.40230101346969604, 0.17319899797439575], [-0.046921998262405396, 0.22489899396896362, 0.04642700031399727], [0.044961001724004745, 0.2211959958076477, -0.19487899541854858], [0.17216600477695465, -0.4043630063533783, -0.27853500843048096], [0.039726998656988144, -0.526233971118927, 0.2870680093765259], [-0.09461499750614166, 0.34681299328804016, 0.11941699683666229], [-0.04363600164651871, 0.35698699951171875, -0.23919999599456787], [0.04397699981927872, -0.5379030108451843, -0.3443470001220703], [-0.03323199972510338, -0.08697900176048279, 0.13420000672340393], [0.03745400160551071, 0.32137998938560486, -0.07704900205135345], [0.11776699870824814, -0.07274600118398666, -0.2640010118484497], [0.2221979945898056, -0.5050389766693115, -0.060120001435279846], [-0.15031099319458008, -0.05879500135779381, 0.26541799306869507], [-0.09531699866056442, 0.5149080157279968, -0.054354000836610794], [-0.000539999979082495, -0.036945998668670654, -0.35615599155426025], [0.06065699830651283, -0.7413700222969055, -0.03266799822449684], [0.13256800174713135, -0.0775889977812767, -0.0804160013794899], [-0.03880799934267998, -0.490092009305954, 0.26592200994491577], [0.12472999840974808, -0.48096799850463867, 0.24591399729251862], [-0.13634300231933594, 0.3252669870853424, 0.11885400116443634], [-0.061117999255657196, 0.30823400616645813, 0.08771999925374985], [-0.07465299963951111, 0.3299430012702942, -0.2244569957256317], [0.002369999885559082, 0.3082379996776581, -0.2216469943523407], [-0.02821199968457222, -0.5000920295715332, -0.31668999791145325], [0.12279800325632095, -0.49018099904060364, -0.32504698634147644], [0.08860699832439423, -0.257625013589859, 0.1735209971666336], [-0.07238099724054337, 0.08300700038671494, 0.07945200055837631], [0.0040270001627504826, 0.2920359969139099, -0.009115000255405903], [0.036816999316215515, 0.28087300062179565, -0.14225199818611145], [0.07021799683570862, 0.08576600253582001, -0.2232069969177246], [0.16161000728607178, -0.2474299967288971, -0.29226699471473694], [0.20757199823856354, -0.474263995885849, -0.19448000192642212], [0.20951500535011292, -0.46863600611686707, 0.08104000240564346], [-0.014251000247895718, -0.2853429913520813, 0.32134300470352173], [-0.09997899830341339, -0.07626300305128098, 0.2206840068101883], [-0.1688999980688095, 0.155117005109787, 0.18940900266170502], [-0.16762100160121918, -0.047279998660087585, 0.2552509903907776], [-0.08988799899816513, 0.4750179946422577, 0.03781000152230263], [-0.027607999742031097, 0.4618400037288666, -0.06477800011634827], [-0.08603999763727188, 0.4704430103302002, -0.15286900103092194], [-0.1539430022239685, 0.4819920063018799, -0.046011000871658325], [-0.01155999954789877, 0.17106099426746368, -0.3022260069847107], [0.06067299842834473, -0.0516120009124279, -0.3319930136203766], [0.024898000061511993, -0.2831929922103882, -0.38997501134872437], [-0.05191899836063385, -0.034890998154878616, -0.3330399990081787], [0.05508499965071678, -0.6912410259246826, -0.21231399476528168], [0.15556000173091888, -0.6763550043106079, -0.04555400088429451], [0.0537710003554821, -0.6866160035133362, 0.15060999989509583], [-0.03316500037908554, -0.6931260228157043, -0.029013000428676605], [0.21719299256801605, -0.2772670090198517, -0.07199999690055847], [0.15295900404453278, -0.07858800143003464, -0.17340199649333954], [0.033201999962329865, 0.1122020035982132, -0.0830330029129982], [0.04702899977564812, -0.08190800249576569, 0.022910000756382942], [0.04142199829220772, -0.27251800894737244, 0.27407199144363403], [-0.12791800498962402, 0.11323899775743484, 0.1486939936876297], [-0.18787500262260437, 0.15913300216197968, 0.1878339946269989], [-0.08702400326728821, -0.2667590081691742, 0.2977389991283417], [-0.019912000745534897, 0.4248709976673126, 0.014175999909639359], [-0.03312800079584122, 0.4169690012931824, -0.14712099730968475], [-0.12880299985408783, 0.4377239942550659, -0.14139600098133087], [-0.14844700694084167, 0.4430760145187378, 0.043244000524282455], [0.03394100069999695, 0.1297149956226349, -0.27879598736763], [0.09851899743080139, -0.26210999488830566, -0.36478498578071594], [-0.04152999818325043, -0.26588699221611023, -0.35805100202560425],[-0.04955900087952614, 0.16102899610996246, -0.28477299213409424], [0.14427199959754944, -0.6332079768180847, -0.2051369994878769], [0.14339199662208557, -0.6248000264167786, 0.122809998691082], [-0.0330829992890358, -0.6400619745254517, 0.1415809988975525], [-0.02837200090289116, -0.6443759799003601, -0.195700004696846], [0.2096019983291626, -0.2613059878349304, -0.18957899510860443], [0.06342700123786926, 0.09074100106954575, -0.15292100608348846], [-0.017680000513792038, 0.09711799770593643, -0.006144999992102385], [0.14804600179195404, -0.266757994890213, 0.05222500115633011]]
preMadeDrop_5 = [[0.09190964698791504, -0.10513913631439209, 0.2881351709365845], [-0.000263407826423645, 0.25880181789398193, 0.18221724033355713], [-0.0304071307182312, 0.3244450092315674, -0.13859236240386963], [0.04880306124687195, -0.2502330541610718, -0.4044233560562134], [-0.03855561465024948, -0.16537117958068848, 0.419094443321228], [-0.08494549244642258, 0.3277343511581421, 0.2558680772781372], [-0.08821644634008408, 0.32762932777404785, -0.10025203227996826], [-0.0886383131146431, -0.33139848709106445, -0.44913995265960693], [0.04883822053670883, 0.05622708797454834, 0.2321094274520874], [0.011120602488517761, 0.32839858531951904, 0.04234611988067627], [0.017999807372689247, 0.1422109603881836, -0.25509846210479736], [0.16064279526472092, -0.29714274406433105, -0.060860276222229004], [-0.08066562563180923, 0.09885203838348389, 0.39918434619903564], [-0.07429726421833038, 0.4229583740234375, 0.08209717273712158], [-0.10759130865335464, 0.06505870819091797, -0.26800286769866943], [-0.03271244093775749, -0.35087907314300537, 0.07338058948516846], [0.08942780643701553, 0.04082143306732178, -0.09708106517791748], [-0.11702360957860947, -0.14545154571533203, 0.3996177911758423], [0.043488338589668274, -0.13874375820159912, 0.3749767541885376], [-0.1387370005249977, 0.31552839279174805, 0.2553051710128784], [-0.029193243011832237, 0.305914044380188, 0.2240666151046753], [-0.12259528040885925, 0.3118581771850586, -0.08424293994903564], [-0.05243249982595444, 0.325278639793396, -0.11172068119049072], [-0.12759562581777573, -0.33810460567474365, -0.43559467792510986], [-0.01747112348675728, -0.2945781946182251, -0.43694770336151123], [0.08726609498262405, -0.0331038236618042, 0.27757203578948975], [0.009658567607402802, 0.15900421142578125, 0.19004642963409424], [0.014667274430394173, 0.2979518175125122, 0.1254826784133911], [-0.010513918474316597, 0.334820032119751, -0.055608391761779785], [-0.022468680515885353, 0.2730981111526489, -0.2152029275894165], [0.061520595103502274, -0.1021949052810669, -0.3084307909011841], [0.08582690358161926, -0.2933746576309204, -0.32376229763031006], [0.12496248632669449, -0.16468966007232666, 0.17091882228851318], [-0.052696067839860916, -0.02932298183441162, 0.45461881160736084], [-0.005874069407582283, 0.08991444110870361, 0.35156452655792236], [-0.09145825356245041, 0.21939623355865479, 0.32508671283721924], [-0.15748900920152664, 0.10477018356323242, 0.390835165977478], [-0.07255467027425766, 0.4003612995147705, 0.1742609739303589], [-0.021063175052404404, 0.39188265800476074, 0.07233870029449463], [-0.0825342983007431, 0.39548158645629883, -0.0149155855178833], [-0.13459978252649307, 0.4043123722076416, 0.09044015407562256], [-0.09792415052652359, 0.23469328880310059, -0.1944953203201294], [-0.04026665538549423, 0.10814487934112549, -0.26736772060394287], [-0.08045850694179535, -0.20225727558135986, -0.45330750942230225], [-0.16064279526472092, 0.05694580078125, -0.2396169900894165], [-0.0715722069144249, -0.4229583740234375, -0.3507763147354126], [0.06518074870109558, -0.33705246448516846, 0.0016216039657592773], [-0.02464212477207184, -0.2574115991592407, 0.2826284170150757], [-0.13509451597929, -0.30094826221466064, 0.10458767414093018], [0.15773295611143112, -0.18868136405944824, -0.11548149585723877], [0.05054252967238426, 0.1381220817565918, -0.1653198003768921], [0.026519648730754852, 0.2426738739013672, -0.04544985294342041], [0.09419599920511246, 0.006369113922119141, 0.06950962543487549], [0.027150442823767662, -0.021017789840698242, 0.404215931892395], [-0.031716205179691315, 0.19622492790222168, 0.2827104330062866], [-0.1518573835492134, 0.2214447259902954, 0.3241935968399048], [-0.13574454933404922, -0.019336938858032227, 0.43264639377593994], [-0.01780170574784279, 0.3719533681869507, 0.1506270170211792], [-0.03892649710178375, 0.3616079092025757, -0.0068160295486450195], [-0.12820342928171158, 0.37820136547088623, -0.004266619682312012], [-0.1312587782740593, 0.3822662830352783, 0.1796950101852417], [-0.059178028255701065, 0.25563931465148926, -0.22764480113983154], [0.0056869350373744965, -0.14925873279571533, -0.3879631757736206], [-0.13349979370832443, -0.21429657936096191, -0.45461881160736084], [-0.13226401060819626, 0.22875261306762695, -0.16190564632415771], [0.01947076991200447, -0.37040185928344727, -0.3513745069503784], [0.06350935250520706, -0.22139739990234375, 0.24852216243743896], [-0.11151639372110367, -0.23039746284484863, 0.27534019947052], [-0.13448897749185562, -0.4212777614593506, -0.3235999345779419], [0.10588526725769043, -0.13044452667236328, -0.2349334955215454], [0.0092279352247715, 0.27863502502441406, -0.14521872997283936], [0.02883552759885788, 0.18389880657196045, 0.09478414058685303], [0.13805920630693436, -0.09816205501556396, 0.09206950664520264]]
preMadeDrop_6 = [[0.11980525404214859, -0.3027130961418152, 0.19559264183044434], [-0.006883827969431877, 0.5047295689582825, 0.28331637382507324], [0.002250167541205883, -0.08061283826828003, -0.2152630090713501], [0.14551080763339996, -0.498696506023407, -0.3307814598083496], [-0.008418986573815346, -0.46535319089889526, 0.27190709114074707], [-0.11091528087854385, 0.6386576294898987, 0.3844025135040283], [-0.04801134020090103, -0.0821654200553894, -0.290935754776001], [0.020453952252864838, -0.6039286255836487, -0.40068143606185913], [0.06410390138626099, 0.12794405221939087, 0.27881932258605957], [0.0004636533558368683, 0.3271253705024719, 0.05923616886138916], [0.09198667109012604, -0.32744449377059937, -0.3233175277709961], [0.17328940331935883, -0.4049413800239563, -0.04920828342437744], [-0.06748733669519424, 0.18980485200881958, 0.435508131980896], [-0.09643350541591644, 0.3585436940193176, 0.04805266857147217], [-0.021553359925746918, -0.3422463536262512, -0.42331570386886597], [0.022307563573122025, -0.6042242646217346, -0.04270637035369873], [0.10014693439006805, -0.1026262640953064, -0.04115116596221924], [-0.08473148941993713, -0.46472829580307007, 0.24340331554412842], [0.07515791058540344, -0.3999442458152771, 0.24749994277954102], [-0.17046502232551575, 0.5769463181495667, 0.36239683628082275], [-0.046119555830955505, 0.6168025135993958, 0.3527054786682129], [-0.0859905257821083, -0.08910006284713745, -0.27197909355163574], [-0.014946399256587029, -0.07481008768081665, -0.2595396041870117], [-0.050803449004888535, -0.5908144116401672, -0.3765389919281006], [0.09732438623905182, -0.5589798092842102, -0.3763740658760071], [0.10724744200706482, -0.11884373426437378, 0.2460317611694336], [0.019148673862218857, 0.3966577649116516, 0.3043471574783325], [0.00861060619354248, 0.469443142414093, 0.1960160732269287], [-0.012393154203891754, 0.12169390916824341, -0.08598899841308594], [0.047487903386354446, -0.24306374788284302, -0.285022497177124], [0.13598743081092834, -0.419028103351593, -0.34829115867614746], [0.17238833010196686, -0.4620996117591858, -0.21672165393829346], [0.15030191838741302, -0.3405589461326599, 0.10654640197753906], [-0.0295783132314682, -0.2388131022453308, 0.34406542778015137], [0.013988737016916275, 0.2074781060218811, 0.40221261978149414], [-0.10701151192188263, 0.5300624966621399, 0.45439445972442627], [-0.15066860616207123, 0.17725306749343872, 0.4170799255371094], [-0.10291925072669983, 0.5787153840065002, 0.24537289142608643], [-0.03763803467154503, 0.39420801401138306, 0.06609845161437988], [-0.08425654470920563, 0.12772232294082642, -0.13953280448913574], [-0.15766574442386627, 0.3454112410545349, 0.058783650398254395], [-0.03185134753584862, -0.23111015558242798, -0.3734201192855835], [0.03954780474305153, -0.3491336703300476, -0.40078771114349365], [0.0033572837710380554, -0.47719401121139526, -0.45439445972442627], [-0.07328067719936371, -0.33807748556137085, -0.3983897566795349], [0.02523002400994301, -0.6341614127159119, -0.24529671669006348], [0.11187472939491272, -0.5162083506584167, -0.03905129432678223], [0.0037273243069648743, -0.5214448571205139, 0.15467774868011475], [-0.06406957656145096, -0.6378185153007507, -0.0631788969039917], [0.16025088727474213, -0.25010257959365845, -0.049777865409851074], [0.1061277911067009, -0.22971183061599731, -0.19011425971984863], [0.039274029433727264, 0.03295665979385376, -0.028783082962036133], [0.09962129592895508, -0.05483967065811157, 0.0798635482788086], [0.04886668920516968, -0.16325920820236206, 0.3281644582748413], [-0.03449393808841705, 0.5063396096229553, 0.41367948055267334], [-0.17328940331935883, 0.4703212380409241, 0.4259570837020874], [-0.11698013544082642, -0.1960431933403015, 0.33654940128326416], [-0.03821533918380737, 0.5729580521583557, 0.2315502166748047], [-0.03980934992432594, 0.1671704649925232, -0.10362839698791504], [-0.12925848364830017, 0.10161429643630981, -0.13134002685546875], [-0.16702041029930115, 0.5482483506202698, 0.24544775485992432], [0.013897307217121124, -0.2606331706047058, -0.3551419973373413], [0.07658727467060089, -0.4613552689552307, -0.4296591281890869], [-0.0632110983133316, -0.466178834438324, -0.42174088954925537],[-0.07023793458938599, -0.23298043012619019, -0.353670597076416], [0.11109709739685059, -0.5704535841941833, -0.23129403591156006], [0.0906611829996109, -0.44971078634262085, 0.13846707344055176], [-0.07751063257455826, -0.5426194071769714, 0.12670087814331055], [-0.05477014183998108, -0.6386576294898987, -0.24077749252319336], [0.1673668771982193, -0.3373352885246277, -0.20997905731201172], [0.04082014411687851, -0.11194556951522827, -0.1573542356491089], [0.03525587543845177, 0.16168469190597534, 0.10833346843719482], [0.12447799742221832, -0.1131334900856018, 0.1308896541595459]]
preMadeDrop_7 = [[0.13758420944213867, -0.2604480981826782, 0.2324308305978775], [0.06325419619679451, 0.35254907608032227, 0.26989175379276276], [-0.034710414707660675, 0.2616152763366699, -0.06481103599071503], [0.048305343836545944, -0.15222012996673584, -0.3472907096147537], [-0.001776406541466713, -0.29514217376708984, 0.30706335604190826], [-0.0400354340672493, 0.4071885347366333, 0.3582348972558975], [-0.10415218770503998, 0.3280794620513916, -0.09820356965065002], [-0.08303897827863693, -0.21479833126068115, -0.42612291872501373], [0.11804724484682083, 0.11064600944519043, 0.2945878654718399], [0.02258932590484619, 0.3474932909011841, 0.0762704461812973], [-0.01655522733926773, 0.06786966323852539, -0.17939235270023346], [0.14381475746631622, -0.3202674388885498, -0.09090723097324371], [-0.013673584908246994, 0.10909926891326904, 0.44405581057071686], [-0.058276109397411346, 0.4996103048324585, 0.08198706805706024], [-0.12618888914585114, 0.09166562557220459, -0.3034658879041672], [-0.01822623983025551, -0.4996103048324585, -0.05342163145542145], [0.09689487516880035, 0.09232258796691895, 0.022259250283241272], [-0.07929671555757523, -0.25778520107269287, 0.3010820299386978], [0.07846371829509735, -0.29133307933807373, 0.2806584984064102], [-0.10500287264585495, 0.397344708442688, 0.3676659017801285], [0.020465772598981857, 0.38567936420440674, 0.32116271555423737], [-0.14792102575302124, 0.3363051414489746, -0.0953284502029419], [-0.06301889568567276, 0.2969323396682739, -0.08399665355682373], [-0.1578686237335205, -0.18584752082824707, -0.3655901104211807], [-0.0008618421852588654, -0.18550550937652588, -0.409127339720726], [0.14585156738758087, -0.06318104267120361, 0.2721049338579178], [0.0877862274646759, 0.25216102600097656, 0.2913617044687271], [0.05863390490412712, 0.3701072931289673, 0.1753189116716385], [-0.013483945280313492, 0.2999424934387207, -0.004953131079673767], [-0.029527738690376282, 0.17851054668426514, -0.10085490345954895], [0.015898358076810837, -0.05188345909118652, -0.2844835966825485], [0.09903714805841446, -0.24148941040039062, -0.2532946616411209], [0.15686866641044617, -0.32295703887939453, 0.09231682121753693], [-0.003156043589115143, -0.06661152839660645, 0.40726615488529205], [0.05881443992257118, 0.1053924560546875, 0.39676518738269806], [-0.02684730663895607, 0.273881196975708, 0.42535366117954254], [-0.09302324056625366, 0.11125242710113525, 0.4302793890237808], [-0.04473021626472473, 0.496785044670105, 0.22731973230838776], [-0.008066529408097267, 0.451485276222229, 0.07571856677532196], [-0.08138249814510345, 0.4270082712173462, -0.022658690810203552], [-0.12451183795928955, 0.48336493968963623, 0.10034795105457306], [-0.12057280540466309, 0.2152162790298462, -0.17663048207759857], [-0.07171488553285599, 0.07395768165588379, -0.2531966120004654], [-0.10158568620681763, -0.0609593391418457, -0.44405581057071686], [-0.18009449541568756, 0.11076033115386963, -0.2702488750219345], [-0.05055899918079376, -0.38843703269958496, -0.27046506106853485], [0.07452376186847687, -0.4680444002151489, -0.07965762913227081], [-0.0034982431679964066, -0.45547330379486084, 0.15068234503269196], [-0.10974632203578949, -0.41992008686065674, -0.018099233508110046], [0.13806626200675964, -0.0970149040222168, -0.03753606975078583], [0.0406126007437706, 0.07359445095062256, -0.08722534775733948], [0.04774266481399536, 0.2190924882888794, 0.06927157938480377], [0.1391335278749466, 0.11526608467102051, 0.15194036066532135], [0.07874327898025513, -0.06530880928039551, 0.3662586361169815], [0.0358562134206295, 0.2588369846343994, 0.3811236768960953], [-0.09830089658498764, 0.26488804817199707, 0.42215724289417267], [-0.08462518453598022, -0.056870102882385254, 0.3918144851922989], [0.015179650858044624, 0.45068466663360596, 0.19620563089847565], [-0.040947526693344116, 0.3848179578781128, -0.01511828601360321], [-0.13346803188323975, 0.4219304323196411, -0.014889582991600037], [-0.11338717490434647, 0.48233115673065186, 0.2554664760828018], [-0.07327161729335785, 0.19090449810028076, -0.14942437410354614], [-0.03676867485046387, -0.04823291301727295, -0.3896312862634659], [-0.17412810027599335, -0.036946773529052734, -0.38368506729602814], [-0.166056826710701, 0.22724783420562744, -0.15922829508781433], [0.0427536703646183, -0.3526962995529175, -0.2811346501111984], [0.0826607495546341, -0.4386003017425537, 0.12304030358791351], [-0.08727362006902695, -0.39591121673583984, 0.1585727483034134], [-0.13653621077537537, -0.35397911071777344, -0.22454522550106049], [0.08065029978752136, -0.08519947528839111, -0.1794440895318985], [0.007319226861000061, 0.1916353702545166, -0.02590368688106537], [0.09583710879087448, 0.25343990325927734, 0.17166535556316376], [0.18009449541568756, -0.07983672618865967, 0.1108478456735611]]
preMadeDrop_8 = [[0.08257836103439331, -0.3389078378677368, -0.27045416831970215], [0.017550203949213028, 0.20319616794586182, -0.2736293077468872], [-0.01757347583770752, 0.2758907079696655, 0.04919558763504028], [0.09931731224060059, -0.33462560176849365, 0.3773221969604492], [-0.06496995687484741, -0.3306591510772705, -0.29894959926605225], [-0.10887405276298523, 0.32665061950683594, -0.19800281524658203], [-0.10877694189548492, 0.3566007614135742, 0.17645204067230225], [-0.04110565036535263, -0.35214459896087646, 0.43473994731903076], [0.08687687292695045, -0.1389230489730835, -0.42217719554901123], [0.01641322299838066, 0.3410825729370117, -0.09735089540481567], [0.05423218198120594, -0.0024121999740600586, 0.1678752303123474], [0.152964249253273, -0.4265962839126587, 0.15977632999420166], [-0.07488691061735153, -0.07742226123809814, -0.3828648328781128], [-0.1228397935628891, 0.5009171962738037, 0.0282590389251709], [-0.0830322653055191, 0.02117443084716797, 0.3297763168811798], [-0.02896970883011818, -0.5009171962738037, 0.17380356788635254], [0.16364377737045288, -0.11173319816589355, -0.20599603652954102], [-0.13848833739757538, -0.2831895351409912, -0.23993241786956787], [0.018828395754098892, -0.3450753688812256, -0.3083699941635132], [-0.16828575730323792, 0.31586647033691406, -0.16396629810333252], [-0.03886972367763519, 0.27397942543029785, -0.24189722537994385], [-0.1544143706560135, 0.33220481872558594, 0.18353629112243652], [-0.05961714684963226, 0.3355276584625244, 0.11859828233718872], [-0.11754769086837769, -0.3099219799041748, 0.3972259759902954], [0.040069110691547394, -0.35230743885040283, 0.41570279002189636], [0.09357874095439911, -0.2734769582748413, -0.37904834747314453], [0.056798601523041725, 0.04857778549194336, -0.38157737255096436], [0.02393447980284691, 0.29931700229644775, -0.19965815544128418], [-0.002921760082244873, 0.32033610343933105, -0.010541975498199463], [0.014783458784222603, 0.14783036708831787, 0.045027732849121094], [0.08887580037117004, -0.20576369762420654, 0.32610172033309937], [0.13919422030448914, -0.3913533687591553, 0.32145822048187256], [0.12391984462738037, -0.40265870094299316, -0.08562541007995605], [-0.07021133601665497, -0.22439229488372803, -0.40133190155029297], [0.009347539395093918, -0.12694132328033447, -0.43473994731903076], [-0.08680714666843414, 0.09909343719482422, -0.3217872381210327], [-0.15240079164505005, -0.01761949062347412, -0.2820448875427246], [-0.12094923853874207, 0.4665663242340088, -0.08805716037750244], [-0.05481693148612976, 0.46524763107299805, -0.01631486415863037], [-0.12002848088741302, 0.4550457000732422, 0.11831545829772949], [-0.19195334613323212, 0.461611270904541, 0.048303961753845215], [-0.09546943753957748, 0.19696581363677979, 0.23928558826446533], [-0.013940252363681793, 0.011446714401245117, 0.26333552598953247], [-0.06096833944320679, -0.17103302478790283, 0.4095654785633087], [-0.14140330255031586, 0.02803504467010498, 0.3251204788684845], [-0.028369106352329254, -0.4694565534591675, 0.3608003258705139], [0.06942427903413773, -0.4947437047958374, 0.18672239780426025], [-0.04465542733669281, -0.43553006649017334, -0.06632274389266968], [-0.12488986551761627, -0.4280369281768799, 0.14698535203933716], [0.19195334613323212, -0.290035605430603, 0.04200613498687744], [0.11856868863105774, -0.052979230880737305, 0.004233419895172119], [0.09856224060058594, 0.10494375228881836, -0.22594833374023438], [0.14646830409765244, -0.1329866647720337, -0.35936152935028076], [0.016021480783820152, -0.25698554515838623, -0.42825496196746826], [-0.011052742600440979, 0.057128190994262695, -0.3780704736709595], [-0.15489599108695984, 0.13117313385009766, -0.24688351154327393], [-0.14986805617809296, -0.1696937084197998, -0.3071558475494385], [-0.04942041635513306, 0.42554545402526855, -0.1274924874305725], [-0.06253768503665924, 0.42716288566589355, 0.06877756118774414], [-0.17616623640060425, 0.425199031829834, 0.13168776035308838], [-0.18484057486057281, 0.4320964813232422, -0.0709349513053894], [-0.0405464842915535, 0.18197870254516602, 0.17761099338531494], [0.017186843790113926, -0.1948401927947998, 0.3833949565887451], [-0.13258129358291626, -0.14133524894714355, 0.38861382007598877], [-0.14394986629486084, 0.18746638298034668, 0.2433147430419922], [0.06416520476341248, -0.46180689334869385, 0.3583606779575348], [0.04571010172367096, -0.4424915313720703, -0.06374001502990723], [-0.12912242114543915, -0.3754079341888428, -0.04893845319747925], [-0.11624176800251007, -0.4074544906616211, 0.31822696328163147], [0.15486235916614532, -0.24755895137786865, 0.22742366790771484], [0.06332339346408844, 0.11155259609222412, -0.10682225227355957], [0.10068048536777496, 0.0858311653137207, -0.3314453363418579], [0.16157762706279755, -0.29852044582366943, -0.20810234546661377]]
# pick random premade drop
if optRandCheckBox == True:
randomPreMadeDrop = random.choice([preMadeDrop_1, preMadeDrop_1, preMadeDrop_1, preMadeDrop_2, preMadeDrop_2, preMadeDrop_2, preMadeDrop_3, preMadeDrop_4, preMadeDrop_7, preMadeDrop_7])
if randomness == 1 and optRandCheckBox == False:
randomPreMadeDrop = preMadeDrop_1
if randomness == 2 and optRandCheckBox == False:
randomPreMadeDrop = randomPreMadeDrop = random.choice([preMadeDrop_1, preMadeDrop_2])
if randomness == 3 and optRandCheckBox == False:
randomPreMadeDrop = randomPreMadeDrop = random.choice([preMadeDrop_1, preMadeDrop_2, preMadeDrop_3])
if randomness == 4 and optRandCheckBox == False:
randomPreMadeDrop = randomPreMadeDrop = random.choice([preMadeDrop_1, preMadeDrop_2, preMadeDrop_3, preMadeDrop_4])
if randomness == 5 and optRandCheckBox == False:
randomPreMadeDrop = randomPreMadeDrop = random.choice([preMadeDrop_1, preMadeDrop_2, preMadeDrop_3, preMadeDrop_4, preMadeDrop_5])
if randomness == 6 and optRandCheckBox == False:
randomPreMadeDrop = randomPreMadeDrop = random.choice([preMadeDrop_1, preMadeDrop_2, preMadeDrop_3, preMadeDrop_4, preMadeDrop_5, preMadeDrop_6])
if randomness == 7 and optRandCheckBox == False:
randomPreMadeDrop = randomPreMadeDrop = random.choice([preMadeDrop_1, preMadeDrop_2, preMadeDrop_3, preMadeDrop_4, preMadeDrop_5, preMadeDrop_6, preMadeDrop_7])
if randomness == 8 and optRandCheckBox == False:
randomPreMadeDrop = randomPreMadeDrop = random.choice([preMadeDrop_1, preMadeDrop_2, preMadeDrop_3, preMadeDrop_4, preMadeDrop_5, preMadeDrop_6, preMadeDrop_7, preMadeDrop_8])
# assign vertices to new position
cmds.select(newWaterDrop)
oldVtxIndexList = cmds.getAttr("%s.vrts"%(newWaterDrop[0]), multiIndices=True)
for i in oldVtxIndexList:
newVtxPos = cmds.xform(".vtx["+str(i)+"]", translation = randomPreMadeDrop[0], worldSpace = True, absolute = True)
del randomPreMadeDrop[0:1]
# assign vertex normal to water drop
cmds.normalConstraint(selectedObject, newWaterDrop, aimVector = (0,0,1), upVector = (0,1,0))
# move the water drop to the vertex
cmds.xform(newWaterDrop, translation = newPosition)
# remove constraint after translation
cmds.delete(newWaterDrop, constraints=True)
# scale the waterdrop to it's appropriate size
cmds.xform(newWaterDrop, os=True, r = True, scale = (randomDropSize, randomDropSize, randomDropSize), ro = (0,-90,0))
# move the drops randomly so they don't appear as structured
cmds.xform(newWaterDrop, os = True, r = True, translation = (random.uniform(-randomDropSize/3, 0), random.uniform(-randomDropSize, randomDropSize), random.uniform(-randomDropSize, randomDropSize)))
# counter for the refresher
counter = counter + 1
if counter == 50:
cmds.refresh( force = True)
counter = 0
# clean up the drop inputs
cmds.delete(newWaterDrop, constructionHistory = True)
break
if cmds.objExists("subDProxy") == True:
cmds.delete("subDProxy")
cmds.group("waterDrop*", name = "waterDrops")
# flush undo history to remove ram usage
cmds.flushUndo()
# script to get the vertex positions of the pre made waterdrops
def vertexWP():
vtxWorldPosition = []
vtxIndexList = cmds.getAttr(".vrts", multiIndices=True )
for i in vtxIndexList :
curPointPosition = cmds.xform(".pnts["+str(i)+"]", query=True, translation=True, worldSpace=True, absolute=True)
vtxWorldPosition.append( curPointPosition )
windowUI()
@eulersson
Copy link

Lovely! I will give it a try Zeno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment