[Maya-Python] Re: ExportSelected
Le jeudi 2 mai 2019 03:25:42 UTC-4, Rémi Deletrain a écrit : > Hi Marcus, > > > > > Any two nodes with a connection will have their connection maintained on > export. > > > This is a problem. In process I disconnect output of pairBlend and after I > export selected nodes. > But at this moment pairBlend node doesn't have output connection and > exportSelected don't take this node even thought it has input connection. > For fix this problem I found solution for select this node too but it's > possible that at terme cause me a problem... I'm not shure... that's odd.. I'm currently facing the exact same issue, and everytime I maintain my output connection but doesn't export the joint, it fails (as expected), but as soon as I remove this connection pairBlend->joint, it works like a charm Another option to avoid working with selection (I find selection-based code super easy to break) could be to put everything in a set and export the content of that set. Eitherway, seems like you have to do maya's job by selecting your nodes prior to exporting... Again, surprising, as it's working fine on my side. Did you try on another maya ? After resetting your prefs ? -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/63b52a72-3e92-4637-a3f3-246f5dd7c042%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: Trying to deform any mesh into a sphere. How to translate the vertex position to lie on a sphere?
hi , not sure I understood what you want to achieve. Ultimately, you want your mesh to look like a sphere ? If yes, I'd suggest you take the longest centroid->vertex to define a sphere radius, then you do a line/sphere intersection between each vector centroid->vertex (normalized) and your implicit sphere. But depending on how your initial mesh looks like, you might have some weird results, so if you want something smoother, I'd go for an iterative operation (e.g. laplacian smooth + push several times) Le lundi 22 avril 2019 14:11:46 UTC-4, Nagaraj Raparthi a écrit : > I am trying to write a deformer script for maya, using the maya API which > deforms any mesh into a sphere by translating it's vertices. > > > What i already have is a deformer which translates every vertex of mesh in > the direction of it's normal with the amount specified. This is done using > the below equation. > > point += normals[itGeo.index()] * bulgeAmount * w * env; > > > Where, point is the vertex on the mesh. normals[itGeo.index()] is a vector > array which represents the normals of each vertex. w and env are to control > the weights of the deformation and the envelope. > > > What this code basically does is, it translates the vertex in the direction > of the normal with the amount specified. While this works for a sphere, > because a sphere's vertex normals would point at the center. It would not > work for other meshes as the normals would not point at the center of the > mesh. > > > float bulgeAmount = data.inputValue(aBulgeAmount).asFloat(); > float env = data.inputValue(envelope).asFloat(); > MPoint point; > float w; > for (; !itGeo.isDone(); itGeo.next()) > { > w = weightValue(data, geomIndex, itGeo.index()); > > point = itGeo.position(); > > point += normals[itGeo.index()] * bulgeAmount * w * env; > > itGeo.setPosition(point); > } > > > > I initially thought changing the direction of translation would solve the > problem. As in, if we can find the vector in the direction from the center of > the mesh to each vertex and translate it along that direction for an amount > specified would solve it. Like so : > > point += (Center - point) * bulgeAmount * w * env; > > > Where, Center is the center of the mesh. But this does not give the desired > result. I also would want the deformer to be setup in such a way that the > user can input radius "r" value and can also change the amount attribute from > 0 to 1 to deform the mesh from it's original state to a spherical one. So > that he can choose a value in between if her desires and the mesh would be > something between a sphere and it's original shape. > > > This is my very first post in this group. I apologize if the format does not > follow the community expectations. Any help on this will be greatly > appreciated. > > > Thank You. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/bb8779d3-28f1-4cbe-a087-4b02c189f850%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Maya-Python] getting all objects affected by a given object
hi Marcus, I initially started with listHistory, which works fine in 99.99% of the situations, but in some complex situations I don't get accurate results (just like sometimes maya fail in setting correctly the purple wireframe), no matter which flags I use. I just wanted to make sure I wasn't missing something obvious, but I'll keep searching. Out of curiosity, any idea how maya is doing it internally ? A regular graph parsing ? Le samedi 13 avril 2019 03:17:55 UTC-4, Marcus Ottosson a écrit : > Hey Vincent, have a look at the cmds.listHistory command. > > > > > On Fri, 12 Apr 2019 at 20:11, wrote: > Hi, > > I was wondering if there is a way to get maya objects affected by a given > object ? > > > > When you select something in the viewport, everything affected by your > selection will be displayed in wireframe purple. Is there a command to get > this result ? (something like obj1.isAffectedBy(obj2) returning a bool) > > The only way I see to do it would be to do some recursive function but I'm > not sure how reliable it'd be (e.g. a constraint would be- connected on both > source/destination to the same network) > > > > Thank you ! > > > > -- > > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email to python_inside_maya+unsubscr...@googlegroups.com. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/97b68173-6c69-42da-81df-2a5345afd0b6%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/63a733e1-118e-4866-ac67-2ef2dfa03497%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] getting all objects affected by a given object
Hi, I was wondering if there is a way to get maya objects affected by a given object ? When you select something in the viewport, everything affected by your selection will be displayed in wireframe purple. Is there a command to get this result ? (something like obj1.isAffectedBy(obj2) returning a bool) The only way I see to do it would be to do some recursive function but I'm not sure how reliable it'd be (e.g. a constraint would be- connected on both source/destination to the same network) Thank you ! -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/97b68173-6c69-42da-81df-2a5345afd0b6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Maya-Python] read c++ MVectorArray by python
Le lundi 18 mars 2019 17:27:16 UTC-4, Justin Israel a écrit : > MVectorArray in python is a SWIG object wrapping the C++ type. I am not sure > of a way to pass a pointer to the C++ MVectorArray and 'wrap' it in Python. > But that would be the lowest overhead if it were possible since you wouldn't > need to copy. > The hacky workaround is to serialize it to something like > /dev/shm/myvector.json and let python deserialize it. That incurs the cost of > having to encode/decode, but avoids the huge literal string call (I am not > sure of the cost differences here). > > > I'm probably missing some other option to solve this. > > > On Tue, Mar 19, 2019 at 6:26 AM wrote: > hi, how i can read or how i can access to MVectorArray of C++ code by python > code? > > right now, i convert C++ MVectorArray to String and run it by > executePythonCommand() func > > > > ( MGlobal::executePythonCommand(c++MVectorArrayToString); ) > > > > but,i Want a faster way... > > > > i think, convert C++ MVectorArray to String, is not good way!(in big arrays) > > > > -- > > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email to python_inside_maya+unsubscr...@googlegroups.com. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/58b6b569-f8cf-418c-828b-7c6c1577c61c%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. If this array is the result of another function called in cpp, maybe you can access it with ctypes and get the result in python. If you want to get your cpp variable content on the fly, then I'd go for Justin's solution (but first I'd try to double check there is no better structure for what I want to achieve) -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c39ad963-8195-4956-b46b-f80e5bff3cfc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Maya-Python] Re: [NurbsCurve] Alogrithm create curve from joints
Same approach as Michael, maybe you should go for a curve that does have the specificity of passing through every point (e.g. Catmull-Rom, kind of a simplified version of hermite, both light and super easy to implement - the wiki page has everything you need ). From there, you can try to approximate a nurbs curve out of it (doing it the other way around seems pretty straight forward : https://forum.libcinder.org/topic/creating-catmull-rom-spline-from-the-bspline-class). Likewise, I'd advice you create your own nurbsCurve object with only what you need, and not necessarily use the maya tools. Again, the wiki page about NURBS has the exact formula (https://fr.wikipedia.org/wiki/NURBS =p ), you just need to translate it into python (basically a cox-deboor recursive algorithm, the internet is full of examples and tutorials about it) Alternatively, if you work in cpp, you can find pretty much everything you need with open source libs for generating curves, converting curves, etc... Finally, depending on your needs, maybe you don't even need to stick to a NURBS curve, and can go for much lighter curves ? (again, catmull-rom for instance ! ) ? Le jeudi 29 novembre 2018 20:19:36 UTC-5, Michael Boon a écrit : > You might try Cardinal splines, which are kind of Hermite splines. They're > not NURBS; they're more like the splines used by animation curves. I've > implemented these in 3D just by considering each axis separately, defining > each axis as a function of some made-up parameter, which is the distance > along the curve. > > This site is pretty good: http://cubic.org/docs/hermite.htm > > > If you specifically want NURBS, or something more like NURBS (eg Beziers), > maybe this site will be useful: > https://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/opengl_programming.html#3 > > On Thursday, 29 November 2018 23:52:52 UTC+11, Rémi Deletrain wrote: > Thank you for the book angelo. I will see if my company wants to buy it. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d4a48788-28a4-4501-9472-1fb837106a44%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] [maya]controller nodes and how to disable them
Hi folks, I start looking at the "controller" nodes (new 2017 feature, if I'm correct), used to tag objects as controllers and (finally !) override maya pickwalks. It works great, but I'm looking for a clean way to disable them : in a nutshell, while I'm still working on the rig, I want to have an accurate pickwalk (e.g. to take the shape of my ctl), and enable all my controller nodes at publish time only, for animators. As expected, none of the native options work (node effect, ...), so I started messing around with the connections (essentially using a "childrenDelayed" attribute instead of the children message array attribute. But then maya becomes a bit unstable. Any suggestion on how to approach this ? Thanks -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/8b2010ee-bc4d-4443-88f9-ac7d0b6b3a1e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: [maya] nurbsCurve node modifying its input curveDatas
Le mardi 6 novembre 2018 09:57:50 UTC-5, Neil Roche a écrit : > I would guess that the curveFromSurfaceIso node will work like a parametric > curve irrespective of whether parametric is set on or off as you have the min > and max U values at 0 and 1 and it has no concept of where to draw any cvs > inbetween. Once you have created the curve by connecting the outputCurve to > the curve.create attribute you now have a curve with 4 cvs so with parametric > off it will function as expected and the locator will move as the cvs are > stretched apart from each other, differently to the motion path with the > curveFromSurfaceIso input. That's my guess anyway. > > > > On Monday, 5 November 2018 18:35:09 UTC, vince touache wrote:Le lundi 5 > novembre 2018 13:28:25 UTC-5, Neil Roche a écrit : > > > Hi, > > > > > > > > > Because of a weird bug in Maya when you set parametric length on a motion > > path you need to set the opposite; > > > > > > > > > cmds.setAttr(mp + '.fractionMode', True) > > > > > > > > > actually turns parametric off. > > > > > > > > > So you need to do > > > > > > > > > cmds.setAttr(mp + '.fractionMode', not True) or cmds.setAttr(mp + > > '.fractionMode', False) > > > > > > > > > > > > To get your code snippet to work. > > > > > > > > > Cheers, > > > > > > > > > Neil > > > > Hi Neil, > > thanks for the answer. Indeed, as you flagged, parametric attribute is the > 'GUI' name, and fractionMode is the core name, parametric==not fractionMode. > > In my example, I explicitely set the fractionMode to True, on purpose, > because this is the behavior I need (i.e. not parametric). > > But my thoughts are more about "what happens in a nurbsCurve node, to change > the output of my curveIso ?" > > > > In other words, I would expect to have the same result in > curveFromSurfaceIso.outputSurface and in nurbsCurve.worldSpace. I don't. > > Any idea of what the nurbsCurve is implicitely doing to my > curveFromSurfaceIso.outputSurface ? Interesting. that's the best guess I came up with so far too ! A bit like some datas not being computed, maybe for optimisation purpose, unless they are explicitely required, which happens when we plug the nurbsCurve. off topic, this situation reminds me a bit of Young's interference experiment (https://en.wikipedia.org/wiki/Young%27s_interference_experiment) where the signal is both a wave and a particle until we force it to choose one ^^ here, the data is can be different things, depending on what we plug after ^^ -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/0eff12d7-c4a6-4ffc-ba8d-0dceaadca56f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: [maya] nurbsCurve node modifying its input curveDatas
Le lundi 5 novembre 2018 13:28:25 UTC-5, Neil Roche a écrit : > Hi, > > > Because of a weird bug in Maya when you set parametric length on a motion > path you need to set the opposite; > > > cmds.setAttr(mp + '.fractionMode', True) > > > actually turns parametric off. > > > So you need to do > > > cmds.setAttr(mp + '.fractionMode', not True) or cmds.setAttr(mp + > '.fractionMode', False) > > > > To get your code snippet to work. > > > Cheers, > > > Neil Hi Neil, thanks for the answer. Indeed, as you flagged, parametric attribute is the 'GUI' name, and fractionMode is the core name, parametric==not fractionMode. In my example, I explicitely set the fractionMode to True, on purpose, because this is the behavior I need (i.e. not parametric). But my thoughts are more about "what happens in a nurbsCurve node, to change the output of my curveIso ?" In other words, I would expect to have the same result in curveFromSurfaceIso.outputSurface and in nurbsCurve.worldSpace. I don't. Any idea of what the nurbsCurve is implicitely doing to my curveFromSurfaceIso.outputSurface ? -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/e228d2fe-180a-4655-8d20-0bb01d8a70ad%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] [maya] nurbsCurve node modifying its input curveDatas
hi folks, I noticed something I never saw before, so I'd like to know if I'm missing something : in a nutshell, I got different results when I connect the outCurve datas from a node to a motionPath, and when I pass the same connection through a nurbsCurve before connecting it to a motionPath. I'm sure an example would be much self-explanatory, so you can run this snippet to see what I mean sks = [cmds.createNode('joint', ss=1) for _ in xrange(2)] nurbs = cmds.nurbsPlane(ch=0, ax=[0,1,0], w=2, lr=4)[0] crv = cmds.duplicateCurve(nurbs + '.u[0.5]', ch=1)[0] curveIso = cmds.listConnections(crv + '.create', s=1, d=0)[0] cmds.setKeyframe(sks[-1], v=-4, at='tz') cmds.currentTime(10) cmds.setKeyframe(sks[-1], v=-14, at='tz') cmds.skinCluster(nurbs, sks, tsb=1) # - first setup mp = cmds.createNode('motionPath') cmds.connectAttr(curveIso + '.outputCurve', mp + '.geometryPath') cmds.setAttr(mp + '.uValue', .2) loc = cmds.spaceLocator()[0] cmds.connectAttr(mp + '.allCoordinates', loc + '.t') cmds.setAttr(mp + '.fractionMode', True) # - second setup mp = cmds.createNode('motionPath') cmds.connectAttr(crv + '.ws', mp + '.geometryPath') cmds.setAttr(mp + '.uValue', .2) loc = cmds.spaceLocator()[0] cmds.connectAttr(mp + '.allCoordinates', loc + '.t') cmds.setAttr(mp + '.fractionMode', True) As you can see if you scroll the timeline, the 2 locators have a different behavior. However, the 2 setups are the same, except for a nurbsCurve (that I'd like to bypass) So I suspect the nurbsCurve does another operation, but I don't know which one exactly and why. Any explanation about that ? cheers -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b3bfc780-fd8e-4942-83d7-e83b532a0da1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Maya-Python] Unload/reload plugin not refreshing correctly
Le mercredi 22 août 2018 18:30:22 UTC-4, Michał Frątczak a écrit : > I didn't find solution, sadly > > > czw., 23 sie 2018, 00:27 użytkownik napisał: > So no working solution, really (based on your thread) ? How did you figure > this out ? > > > > > > > > Le mercredi 22 août 2018 18:16:34 UTC-4, vince touache a écrit : > > > hahaha I just found your thread via google, like 2 seconds ago ! Will have > > a look at it, thanks > > > > > > Le mercredi 22 août 2018 18:15:30 UTC-4, Michał Frątczak a écrit : > > > > I tried to link to similar post of mine, search this group for > > > > maya does not update recompilled plugin under linux > > > > > > > > > > > > czw., 23 sie 2018, 00:11 użytkownik Michał Frątczak > > > napisał: > > > > > > > > https://groups.google.com/forum/m/#!searchin/python_inside_maya/Plugin/python_inside_maya/QP7twlg54C4 > > > > > > > > > > > > czw., 23 sie 2018, 00:06 użytkownik napisał: > > > > Hi, > > > > > > > > > > > > > > > > I'm compiling a plugin in a different environment from usually, and I'm > > > experiencing some weird behaviors : > > > > > > > > What I usually do when I modify my plugin is (in a scene where the plugin > > > is loaded already) : > > > > > > > > - delete any node from the plugin > > > > > > > > - flush undo > > > > > > > > - unload the plugin > > > > > > > > - reload the plugin > > > > > > > > - create my node > > > > > > > > > > > > > > > > What happens here is my plugin won't be updated, even after recompiling / > > > unloading-reloading it. If I restart maya, however, it will reload my > > > plugin correctly. > > > > > > > > > > > > > > > > I assume maya is keeping the .so in memory somehow (maybe creating an nfs > > > copy ? but I couldn't find it), but I wonder how to clear it, and why it > > > never happened to me before... > > > > > > > > > > > > > > > > Any idea ? > > > > > > > > Thanks > > > > > > > > > > > > > > > > (I tried with maya 2016, 2017, 2018, on linux) > > > > > > > > > > > > > > > > -- > > > > > > > > You received this message because you are subscribed to the Google Groups > > > "Python Programming for Autodesk Maya" group. > > > > > > > > To unsubscribe from this group and stop receiving emails from it, send an > > > email to python_inside_maya+unsubscr...@googlegroups.com. > > > > > > > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/python_inside_maya/0fe18624-3ffa-4c99-869e-1fd2e3b368f8%40googlegroups.com. > > > > > > > > For more options, visit https://groups.google.com/d/optout. > > > > -- > > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email to python_inside_maya+unsubscr...@googlegroups.com. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/150bf27a-eed1-47c3-aa2c-81bd5ab253a0%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. So apparently it has to do with my environment when I compile. I may have found a solution (or at least I wanna try it, as it looks really like magic to me !) http://www.sonictk.com/runtime-compiled-c-in-maya/ -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/3e9c8f59-88bf-4835-84f5-0569ea40668d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Maya-Python] Unload/reload plugin not refreshing correctly
So no working solution, really (based on your thread) ? How did you figure this out ? Le mercredi 22 août 2018 18:16:34 UTC-4, vince touache a écrit : > hahaha I just found your thread via google, like 2 seconds ago ! Will have a > look at it, thanks > > Le mercredi 22 août 2018 18:15:30 UTC-4, Michał Frątczak a écrit : > > I tried to link to similar post of mine, search this group for > > maya does not update recompilled plugin under linux > > > > > > czw., 23 sie 2018, 00:11 użytkownik Michał Frątczak > > napisał: > > > > https://groups.google.com/forum/m/#!searchin/python_inside_maya/Plugin/python_inside_maya/QP7twlg54C4 > > > > > > czw., 23 sie 2018, 00:06 użytkownik napisał: > > Hi, > > > > > > > > I'm compiling a plugin in a different environment from usually, and I'm > > experiencing some weird behaviors : > > > > What I usually do when I modify my plugin is (in a scene where the plugin > > is loaded already) : > > > > - delete any node from the plugin > > > > - flush undo > > > > - unload the plugin > > > > - reload the plugin > > > > - create my node > > > > > > > > What happens here is my plugin won't be updated, even after recompiling / > > unloading-reloading it. If I restart maya, however, it will reload my > > plugin correctly. > > > > > > > > I assume maya is keeping the .so in memory somehow (maybe creating an nfs > > copy ? but I couldn't find it), but I wonder how to clear it, and why it > > never happened to me before... > > > > > > > > Any idea ? > > > > Thanks > > > > > > > > (I tried with maya 2016, 2017, 2018, on linux) > > > > > > > > -- > > > > You received this message because you are subscribed to the Google Groups > > "Python Programming for Autodesk Maya" group. > > > > To unsubscribe from this group and stop receiving emails from it, send an > > email to python_inside_maya+unsubscr...@googlegroups.com. > > > > To view this discussion on the web visit > > https://groups.google.com/d/msgid/python_inside_maya/0fe18624-3ffa-4c99-869e-1fd2e3b368f8%40googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/150bf27a-eed1-47c3-aa2c-81bd5ab253a0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Unload/reload plugin not refreshing correctly
Hi, I'm compiling a plugin in a different environment from usually, and I'm experiencing some weird behaviors : What I usually do when I modify my plugin is (in a scene where the plugin is loaded already) : - delete any node from the plugin - flush undo - unload the plugin - reload the plugin - create my node What happens here is my plugin won't be updated, even after recompiling / unloading-reloading it. If I restart maya, however, it will reload my plugin correctly. I assume maya is keeping the .so in memory somehow (maybe creating an nfs copy ? but I couldn't find it), but I wonder how to clear it, and why it never happened to me before... Any idea ? Thanks (I tried with maya 2016, 2017, 2018, on linux) -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/0fe18624-3ffa-4c99-869e-1fd2e3b368f8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] drawing openGl in a deformer / VP2.0
hi there, I'm prototyping a deformer in python / maya2017, and while I usually draw a lot of openGL for debugging purpose (draw points, curves, vectors, etc...), I'm facing an issue with m2017/vp2. The drawing is working differently in the new viewport, and I can't find a way of drawing, when not using a locator. Does anyone know how to draw openGL in VP2 outside of the usual workflow (i.e. some call to openGl in the deform method, like I was doing with VP1) Any help will be really appreciated ! Thanks =] -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/2132f62a-642f-4a02-a18f-96a06b614c1e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: Create customised shader with Python - maya
def createShader(shaderType='aiStandard', name='CHROME'): name = pm.shadingNode(shaderType, asShader=True, name=name or shaderType) sg = pm.sets(renderable=True, noSurfaceShader=True, empty=True, name='%sSG' %(name)) pm.setAttr('%s.weight' %(name),0.25) -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/372af65c-7101-4d84-8a46-4a9235ddd025%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Maya-Python] Re: Symbol not found (on Maya2017 / MacOS)
hahahaha ! You want the awful truth ? this "someone" will probably be me... it happened to me a couple of times -___-' No judgment please =p (And this is how I became my self-hero ^^) Le mardi 17 avril 2018 18:59:50 UTC-4, Marcus Ottosson a écrit : > Haha, your messages are hilarious. Best monologues on the Python Inside Maya > mailing list. :) Don't stop though, these will sit on Google until someone > has the same problem, at which point you'll be the hero. > > > On 18 April 2018 at 06:34,wrote: > djsus, how is it possible to be so stupid -___-' > > One more time, I found my solution a few minutes after I create the post... I > just forgot to edit my cmakeList file and update the maya version number... > smart... > > > > Sorry about that ! > > > > > > > > Le mardi 17 avril 2018 17:24:34 UTC-4, vince touache a écrit : > > > Hello, > > > > > > I'm trying to compile some of my plugins for maya 2017, and am facing an > > error I don't understand. > > > While everything seems to work fine on 2015, when I try to load my plugin > > in 2017, I got this error : > > > Symbol not found: __ZN15MPxDeformerNode10outputGeomE > > > > > > I have no idea what that means, did something change between 2017 and 2015 ? > > > Anyone have an idea of where this comes from and how to fix it ? > > > > > > Many thanks ! > > > > > > > > > complete log : > > > # Error: Unable to dynamically load : /path/to/my/deformer.bundle > > > dlopen(/path/to/my/deformer.bundle, 1): Symbol not found: > > __ZN15MPxDeformerNode10outputGeomE > > > Referenced from: /path/to/my/deformer.bundle > > > Expected in: > >/Applications/Autodesk/maya2017/Maya.app/Contents/MacOS/libOpenMayaAnim.dylib > > > in /path/to/my/deformer.bundle # > > > # Error: dlopen(/path/to/my/deformer.bundle, 1): Symbol not found: > > __ZN15MPxDeformerNode10outputGeomE > > > Referenced from: /path/to/my/deformer.bundle > > > Expected in: > >/Applications/Autodesk/maya2017/Maya.app/Contents/MacOS/libOpenMayaAnim.dylib > > > in /path/to/my/deformer.bundle (nameOfMyDeformer) # > > > > -- > > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email to python_inside_maya+unsubscr...@googlegroups.com. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/02dbcf53-b831-4e33-b20e-7719ea57de96%40googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/6f7a9533-fdcc-4e06-93ac-f8d35500863e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: Symbol not found (on Maya2017 / MacOS)
djsus, how is it possible to be so stupid -___-' One more time, I found my solution a few minutes after I create the post... I just forgot to edit my cmakeList file and update the maya version number... smart... Sorry about that ! Le mardi 17 avril 2018 17:24:34 UTC-4, vince touache a écrit : > Hello, > > I'm trying to compile some of my plugins for maya 2017, and am facing an > error I don't understand. > While everything seems to work fine on 2015, when I try to load my plugin in > 2017, I got this error : > Symbol not found: __ZN15MPxDeformerNode10outputGeomE > > I have no idea what that means, did something change between 2017 and 2015 ? > Anyone have an idea of where this comes from and how to fix it ? > > Many thanks ! > > > complete log : > # Error: Unable to dynamically load : /path/to/my/deformer.bundle > dlopen(/path/to/my/deformer.bundle, 1): Symbol not found: > __ZN15MPxDeformerNode10outputGeomE > Referenced from: /path/to/my/deformer.bundle > Expected in: > /Applications/Autodesk/maya2017/Maya.app/Contents/MacOS/libOpenMayaAnim.dylib > in /path/to/my/deformer.bundle # > # Error: dlopen(/path/to/my/deformer.bundle, 1): Symbol not found: > __ZN15MPxDeformerNode10outputGeomE > Referenced from: /path/to/my/deformer.bundle > Expected in: > /Applications/Autodesk/maya2017/Maya.app/Contents/MacOS/libOpenMayaAnim.dylib > in /path/to/my/deformer.bundle (nameOfMyDeformer) # -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/02dbcf53-b831-4e33-b20e-7719ea57de96%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Symbol not found (on Maya2017 / MacOS)
Hello, I'm trying to compile some of my plugins for maya 2017, and am facing an error I don't understand. While everything seems to work fine on 2015, when I try to load my plugin in 2017, I got this error : Symbol not found: __ZN15MPxDeformerNode10outputGeomE I have no idea what that means, did something change between 2017 and 2015 ? Anyone have an idea of where this comes from and how to fix it ? Many thanks ! complete log : # Error: Unable to dynamically load : /path/to/my/deformer.bundle dlopen(/path/to/my/deformer.bundle, 1): Symbol not found: __ZN15MPxDeformerNode10outputGeomE Referenced from: /path/to/my/deformer.bundle Expected in: /Applications/Autodesk/maya2017/Maya.app/Contents/MacOS/libOpenMayaAnim.dylib in /path/to/my/deformer.bundle # # Error: dlopen(/path/to/my/deformer.bundle, 1): Symbol not found: __ZN15MPxDeformerNode10outputGeomE Referenced from: /path/to/my/deformer.bundle Expected in: /Applications/Autodesk/maya2017/Maya.app/Contents/MacOS/libOpenMayaAnim.dylib in /path/to/my/deformer.bundle (nameOfMyDeformer) # -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/751f0562-7236-444f-a0f0-d49d00406619%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: [Pyside2] Transparent Widget
Le mardi 17 avril 2018 08:02:54 UTC-4, Rémi Deletrain a écrit : > I found solution. > > > With PySide QWidget transparancy have bug with QGraphicWidget. If > QGraphicWidget have parent widget with transparent background mouseClickEvent > doens't work. > With PySide2 this bug is fixed. > > > For fix this problem with Pyside I use steelSheet and set background rgba to > 1.0 and I hide background. > But with PySide2 transparency option is different and show background. But > this trick is not util now. I haven't face this issue yet, but it'll come, for sure ! Thanks for the answer =] -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5a1db82e-849b-468a-aaa8-9a66bb28c2cd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: [PySide] Parenting a QWidget to a QTreeWidgetItem crashes
there is something really magic with this forum... I try not to post unless I'm really stuck, and running out of ideas. But somehow, everytime I post here, I find a solution to my problem within the day(s) So again, a few hours after I created this topic, I found the solution ^^ If someone else has the same issue : I just had to give a parent to my label if I create it in the class ! So problem solved =] thank you ! -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f0d85165-3018-4296-930a-61f1e42602f1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] [PySide] Parenting a QWidget to a QTreeWidgetItem crashes
hi, I'm trying to add an icon to a QTreeWidget, and maya doesn't seem to like the way I do it.. I've got two versions below, the first one is working fine(ish), the second makes maya crash, and I'd like to understand why ! from PySide.QtGui import * # working version tree = QTreeWidget() tree.show() tree.setColumnCount(2) itm = QTreeWidgetItem(tree, ['item1']) # widget creation w = QWidget() lyt = QHBoxLayout(w) lbl = QLabel('---') lyt.addWidget(lbl) itm.setSizeHint(1, w.sizeHint()) tree.setItemWidget(itm, 1, w) # OPTION B class QNode(QTreeWidgetItem): def __init__(self, parent, name_list): super(QNode, self).__init__(parent, name_list) def attach_icon(self): # widget creation icons_widget = QWidget() lyt = QHBoxLayout(icons_widget) start_lbl = QLabel('---') lyt.addWidget(start_lbl) self.setSizeHint(1, icons_widget.sizeHint()) self.treeWidget().setItemWidget(self, 1, icons_widget) tree = QTreeWidget() tree.show() tree.setColumnCount(2) itm = QNode(tree, ['item1']) itm.attach_icon() I'm running out of ideas, so any suggestion or hint you have is more than welcome =] Thank you ! -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/04057bec-6ec8-413c-8c67-bb0dbbed7dac%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: writing compound attributes
quick update in case someone else has the problem.. I just realized I was missing MArrayDataBuilder.addArrayElement() with the api2.0 not because it's been replaced by something else, but just because it's not implemented yet in 2017. Supposed to be available in 2018 (according to the documentation), but in fact, it's not... so I'm back to old api1.. again ^^ Le mercredi 21 février 2018 23:05:25 UTC-5, vince touache a écrit : > hi ! > > I'm writing a node with compound attributes, and, as always, I'm struggling > with syntax ! > I want my attributes to have this hierarchy : > element > |__element[0] > |__ element[0].position > |__element[0].positionX > |__element[0].positionY > |__element[0].positionZ > |__ element[0].rotation > |__ ... > |_ element[1] > |__ etc... > > (Position is an MFnNumericAttribute.createPoint() and orientation is an > array, and my attributes are outputs) > > So the declaration is done correctly, but when I need to write them with the > databuilder, it's getting a bit more tricky : > > hElement = data.outputArrayValue(Node.aElement) > bElement = hElement.builder() > and finally > for i in xrange(num_elements): > bElement.addElement(i).setFloatVector(0, 1, 0) > > Obviously, I'm doing something wrong, because my node always returns 0,0,0. > I think I'm actually pointing to the parent, but don't know how to access to > the child, from there. > Any idea ? > > Thanks > > (I'm using the python api2.0 for this one) -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/2e9f8566-86e6-4240-9887-37a85ede521b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] writing compound attributes
hi ! I'm writing a node with compound attributes, and, as always, I'm struggling with syntax ! I want my attributes to have this hierarchy : element |__element[0] |__ element[0].position |__element[0].positionX |__element[0].positionY |__element[0].positionZ |__ element[0].rotation |__ ... |_ element[1] |__ etc... (Position is an MFnNumericAttribute.createPoint() and orientation is an array, and my attributes are outputs) So the declaration is done correctly, but when I need to write them with the databuilder, it's getting a bit more tricky : hElement = data.outputArrayValue(Node.aElement) bElement = hElement.builder() and finally for i in xrange(num_elements): bElement.addElement(i).setFloatVector(0, 1, 0) Obviously, I'm doing something wrong, because my node always returns 0,0,0. I think I'm actually pointing to the parent, but don't know how to access to the child, from there. Any idea ? Thanks (I'm using the python api2.0 for this one) -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/af89ea57-5b3a-42b0-ba55-6a65001627dd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: Tagging MB files with metadata
I'd be curious to find something as well ! I had a quick look at it ages ago, and couldn't find anything robust. If you're on Unix, you can attach infos against a file (including a .mb), but that doesn't seem to exist on windows. And I'd like to find something cross-platform You can also write notes in maya, but then, as you said, you need to open the file, and even in standalone mode, it can take some time.. However, I think the safest option would be to deal with separated config files. As you say, one can 'break' the pipeline by moving the config file away from its scene file, but I'd say it is acceptable... I mean if an animator removes everything in the outliner, he can't complain the rig is broken ; if someone starts messing around with files he doesn't know, pipeline can't be responsible for that. Still, by curiosity, I'd be curious to know if there is a way of storing infos against an .mb file Le vendredi 9 février 2018 18:08:05 UTC-5, AK Eric a écrit : > It would be of great use if I could (somehow) tag mb files with metadata that > could be read at system level, never having to open the mb itself in Maya. > > > I already have a solution that will save out a json/xml next to the file > whenever the users saves, with queryable info. But this is lossy, can > decouple from the file if it's ever moved, etc. > > > Being able to tag an actual mb with data would be great (in the same way you > can say, check exif data on an image). > > > I've tried some examples doing this in Python with pickle, on both ma & mb > files, but... it corrupts the files. Ironically, I can store and retrieve > metadata, it just wrecks everything else in the file :P > > > Maybe not possible. But I thought I'd see if someone actually had a more > elegant solution for this. > > > thanks -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ddc6fc6f-6e6f-40ea-bd3d-3a983f19c355%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: See which faces are affected by polyChipOff?
Alternately, and especially since speed seems to be a concern, what you can do is to re-write your own extract/duplicate command with python api. This is what I use instead of maya commands, it takes about 50lines to can get all the infos you need to create a new polygon. And, surprisingly, re-creating the poly instead of using maya nodes give you a tremendous gain of speed, especially if you work on heavy meshs and extract many faces on the same object. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/8e25d891-d886-4fc1-a477-f80d4106dc4d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: See which faces are affected by polyChipOff?
I'm not sure I understand what you want to achieve, but can't you use the python version instead of the mel one ? a = cmds.polyChipOff(dup=False) b = cmds.polySeparate(your_mesh) this way, you get a proper return value in a and b that you can work with. What do you need to do exactly ? -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d4b3ce1a-5819-4342-a884-73c58b9480dd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Maya-Python] Re: Scale font in viewer.drawText() api call
I remember having the same issue a few years ago (drawText() is REALLY small ^^), and I couldn't find any solution. I ended up writing my text using openGL instead of maya. something like void yourLoc::vBitmapOutput(int x, int y, char *string, void *font){ int len; glRasterPos2f(x,y) // position of the first char of the chain len = (int) strlen(string) // get the length of the chain // display each element of the string for (unsigned int i(0); i
[Maya-Python] Querying rgb values inside a MPxLocatorNode for drawingOverride / overrideColor implementation
Hi guys, while working on a new MPxLocatorNode, I was wondering something : how could I implement the drawingOverride (and more specifically the overrideColor) to my openGL drawing ? Since drawingOverride is inherited by the MPxLocatorNode class, we might have some handles inside the node, no ? What I'm usually doing for that is querying the colorOverride value (an int from 0 to 31), and based on that, I pick the corresponding rgb value in an predefined array, then I feed my glColor with that... this looks pretty cumbersome.. is there a way to get the rgb value automatically, from maya directly ? Thank you =] -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/4cb2d4d6-5b40-473d-8098-ee8f139e9e23%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.