-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspliceMayaNode2.splice
1 lines (1 loc) · 4.94 KB
/
spliceMayaNode2.splice
1
{"version":"1010000","info":{"hostAppName":"Maya","hostAppVersion":"2013 x64"},"nodes":[{"name":"DGNode","members":[{"name":"angleA","type":"Scalar","persistence":true,"default":"1.600000023841858"},{"name":"angleB","type":"Scalar","persistence":true,"default":"2.421699285507202"},{"name":"angleC","type":"Scalar","persistence":true,"default":"6.28000020980835"},{"name":"geo","type":"PolygonMesh"},{"name":"moveA","type":"Vec3","persistence":true,"default":"{\"x\":20,\"y\":0,\"z\":0}"},{"name":"nbSpheres","type":"Integer","persistence":true,"default":"5"},{"name":"offsetMat","type":"Mat44","persistence":true,"default":"{\"row0\":{\"x\":1,\"y\":0,\"z\":0,\"t\":0},\"row1\":{\"x\":0,\"y\":1,\"z\":0,\"t\":0},\"row2\":{\"x\":0,\"y\":0,\"z\":1,\"t\":0},\"row3\":{\"x\":0,\"y\":0,\"z\":0,\"t\":1}}"},{"name":"rootMat","type":"Mat44","persistence":true,"default":"{\"row0\":{\"x\":1,\"y\":0,\"z\":0,\"t\":0},\"row1\":{\"x\":0,\"y\":1,\"z\":0,\"t\":0},\"row2\":{\"x\":0,\"y\":0,\"z\":1,\"t\":0},\"row3\":{\"x\":0,\"y\":0,\"z\":0,\"t\":1}}"},{"name":"scaleFactor","type":"Scalar","persistence":true,"default":"0.8999999761581421"},{"name":"shells","type":"Integer","persistence":true,"default":"36"},{"name":"spans","type":"Integer","persistence":true,"default":"11"},{"name":"spans2","type":"Integer","persistence":true,"default":"12"},{"name":"thickness","type":"Scalar","persistence":true,"default":"0.1000000014901161"}],"dependencies":{},"bindings":[{"operator":{"name":"spheresOp","entry":"spheresOp","filename":"spheresOp.kl","kl":"require PolygonMesh;\nrequire Vec3;\nrequire Vec4;\nrequire SInt32;\nrequire Scalar;\nrequire Xfo;\nrequire Quat;\n\nfunction createSphere(Xfo root, Integer spans, Integer spans2, io PolygonMesh sphere, Scalar angleA ,Scalar angleB)\n{\n Vec3 profile[];\n for(Size i=0;i<spans;i++)\n {\n Vec3 pos(0, 1, 0.001);\n if(i > 0)\n {\n Quat q;\n q.setFromEulerAngles(Vec3(i * angleA / Scalar(spans - 1), 0.0, 0.0));\n pos = q.rotateVector(pos);\n }\n profile.push(pos);\n }\n\n Xfo xfos[];\n for(Size i=0;i<spans2;i++)\n {\n Xfo offset;\n offset.setIdentity();\n if(i > 0)\n offset.ori.setFromEulerAngles(Vec3(0.0, 0.0, -Scalar(i) * angleB / Scalar(spans2 - 1)));\n xfos.push(root * offset);\n }\n\n sphere.addExtrusion(xfos, profile, false);\n}\n\noperator spheresOp(Integer nbSpheres, Integer spans, Integer spans2, Integer shells, Scalar scaleFactor, Mat44 rootMat, Mat44 offsetMat, Vec3 moveA, Scalar angleA ,Scalar angleB, Scalar angleC, io PolygonMesh geo, Scalar thickness) {\n geo.clear();\n \n Xfo root;\n root.setFromMat44(rootMat);\n\n Xfo offset;\n offset.setFromMat44(offsetMat);\n \n Xfo inc;\n inc.setIdentity();\n inc.tr = moveA / Scalar(shells-1);\n inc.sc *= scaleFactor;\n inc.ori.setFromEulerAngles(Vec3(0.1, 0.1, 0.0));\n\n for(Size i=0;i<nbSpheres;i++)\n {\n Xfo base = root;\n if(i > 0)\n {\n Quat q;\n q.setFromEulerAngles(Vec3(0.0, Scalar(i) * angleC / Scalar(nbSpheres), 0.0));\n base.ori = base.ori * q;\n }\n base = base * offset;\n for(Size j=0;j<shells;j++)\n {\n PolygonMesh sphere = PolygonMesh();\n createSphere(base, spans, spans2, sphere, angleA, angleB);\n geo.mergeMesh(sphere);\n base = base * inc;\n }\n }\n \n geo.addShell(thickness);\n geo.recomputePointNormals(Math_degToRad(60));\n}\n","portmap":{}}}]}],"ports":[{"name":"angleA","node":"DGNode","graph":"mayaGraph1","type":"Scalar","autoInitObjects":true,"member":"angleA","mode":"in"},{"name":"angleB","node":"DGNode","graph":"mayaGraph1","type":"Scalar","autoInitObjects":true,"member":"angleB","mode":"in"},{"name":"angleC","node":"DGNode","graph":"mayaGraph1","type":"Scalar","autoInitObjects":true,"member":"angleC","mode":"in"},{"name":"geo","node":"DGNode","graph":"mayaGraph1","type":"PolygonMesh","autoInitObjects":true,"member":"geo","mode":"out"},{"name":"moveA","node":"DGNode","graph":"mayaGraph1","type":"Vec3","autoInitObjects":true,"member":"moveA","mode":"in"},{"name":"nbSpheres","node":"DGNode","graph":"mayaGraph1","type":"Integer","autoInitObjects":true,"member":"nbSpheres","mode":"in"},{"name":"offsetMat","node":"DGNode","graph":"mayaGraph1","type":"Mat44","autoInitObjects":true,"member":"offsetMat","mode":"in"},{"name":"rootMat","node":"DGNode","graph":"mayaGraph1","type":"Mat44","autoInitObjects":true,"member":"rootMat","mode":"in"},{"name":"scaleFactor","node":"DGNode","graph":"mayaGraph1","type":"Scalar","autoInitObjects":true,"member":"scaleFactor","mode":"in"},{"name":"shells","node":"DGNode","graph":"mayaGraph1","type":"Integer","autoInitObjects":true,"member":"shells","mode":"in"},{"name":"spans","node":"DGNode","graph":"mayaGraph1","type":"Integer","autoInitObjects":true,"member":"spans","mode":"in"},{"name":"spans2","node":"DGNode","graph":"mayaGraph1","type":"Integer","autoInitObjects":true,"member":"spans2","mode":"in"},{"name":"thickness","node":"DGNode","graph":"mayaGraph1","type":"Scalar","autoInitObjects":true,"member":"thickness","mode":"in"}]}