Re: [Maya-Python] About writing a custom Maya Python wrapper

2024-05-11 Thread Marcus Ottosson
Ooo more wrappers. :) I’ve got one too you could reference for things like undo. - https://github.com/mottosso/cmdx There’s also omx, along with a comparison of the two I made not too long ago. - https://learn.ragdolldynamics.com/blog/20240101_omx_vs_cmdx For a UUID, Maya already

[Maya-Python] PySide6 Transition Guide

2024-05-09 Thread Marcus Ottosson
Hi all, With Maya 2025 released, we're now in the domain of PySide6 and Qt 6. We've updated Qt.py to account for this, keeping code written with PySide2, PySide, PyQt4 and PyQt5 running in Maya 2025. - https://github.com/mottosso/Qt.py I've put a transition guide towards the bottom with known

[Maya-Python] Re: C++ already deleted

2024-03-23 Thread Marcus Ottosson
It would certainly help if you could provide an example of something that causes the error, or at the very least a stacktrace of the error. On Saturday 23 March 2024 at 18:04:59 UTC rainonthescare...@gmail.com wrote: > Hi, > i ve been working for quite some time now and occasionally bumped into

Re: [Maya-Python] cmdx vs. omx - Comparison of Maya Python API 2.0 wrappers

2024-02-27 Thread Marcus Ottosson
I wanted to share it with a coworker yesterday, but the page on your blog > does not exist anymore. > Is it a technical problem or did you remove it on purpose? > > Best regards. > > Nicolas > > > Le mar. 2 janv. 2024 à 20:26, Marcus Ottosson a > écrit : > >> Hi

Re: [Maya-Python] Pyblish Error.

2024-02-26 Thread Marcus Ottosson
Heya, typed up a reply for you here. - https://forums.pyblish.com/t/maya2022-running-publish/663/7 On Fri, 23 Feb 2024 at 22:58, Daniel Gayoso wrote: > Hello Guys, > > I am trying to install pyblish and pyblish_qml, however I have had a lot > of problems and I can't get it to work properly. I

Re: [Maya-Python] Re: Widgets in maya viewport

2024-01-08 Thread Marcus Ottosson
tly into the > viewport? Are you just using MPxDrawOverride? If so, how can you achieve > widget-like behavior (like a button) with DrawOverride classes? > > Bests, > -MatinF > On Wednesday, July 20, 2022 at 1:41:41 AM UTC+4:30 Marcus Ottosson wrote: > >> Oh hey, I missed this! >

[Maya-Python] cmdx vs. omx - Comparison of Maya Python API 2.0 wrappers

2024-01-02 Thread Marcus Ottosson
Hi all, There was a recent project by Animal Logic which was akin to one I had done myself, I've taken some time over the holiday (Happy New Year!) to compare the two and ended up essentially documenting parts of the Maya API in the process. :D It turned out quite well, so I figured I'd share it

Re: [Maya-Python] Re: OpenMaya.MPxNode.isPassiveOutput Challenges

2023-12-05 Thread Marcus Ottosson
adding my noise to the node's > matrix itself (I can't add an offset group for controllers for a lot of > reasons). Regards, Matin F > > > On Wednesday, November 29, 2023 at 9:32:15 PM UTC+3:30 Marcus Ottosson > wrote: > >> Hello again, it's me from that Autodesk

[Maya-Python] Re: OpenMaya.MPxNode.isPassiveOutput Challenges

2023-11-29 Thread Marcus Ottosson
Hello again, it's me from that Autodesk forum thread. :) Indeed I was also unable to tackle this challenge, which is ultimately an issue of cyclic dependency. 1. User manipulates transform 2. Transform feeds into custom noise node 3. Noise node feeds into transform The pairBlend does a good

Re: [Maya-Python] Query maya scene info with references

2023-11-15 Thread Marcus Ottosson
Agnihotri wrote: > Hi, no, not for this one. Only file name and path. > On Wed 15. Nov 2023 at 09:20, Marcus Ottosson > wrote: > >> Aha, you are trying to find the path to the referenced file? In that >> case, Maya maintains each reference in a node of type “reference”. You c

Re: [Maya-Python] Query maya scene info with references

2023-11-15 Thread Marcus Ottosson
e.g. walk.ma. I am trying query the >> scene name so that I can export a fbx with same name. How ever, scenes with >> references are not returning anything. >> >> On Tue 14. Nov 2023 at 23:11, Marcus Ottosson >> wrote: >> >>> That definitely should work, independen

Re: [Maya-Python] Hiding individual tabs in a tab layout?

2023-11-15 Thread Marcus Ottosson
t 2:07 PM Marcus Ottosson > wrote: > >> It would depend on how the tabs are made, are they made via PySide or >> cmds? >> >> On Tue, 14 Nov 2023 at 16:27, Ravi Jagannadhan wrote: >> >>> Hi all, is it possible to hide individual tabs in a tab layout? >&

Re: [Maya-Python] Query maya scene info with references

2023-11-14 Thread Marcus Ottosson
That definitely should work, independent of references. How can I reproduce what you see? Here’s what I see: from maya import cmds # Make an original scene to reference cmds.polyCube() cmds.file(rename="referenceMe.ma") cmds.file(save=True, type="mayaAscii") # Make a new scene, and reference the

Re: [Maya-Python] Hiding individual tabs in a tab layout?

2023-11-14 Thread Marcus Ottosson
It would depend on how the tabs are made, are they made via PySide or cmds? On Tue, 14 Nov 2023 at 16:27, Ravi Jagannadhan wrote: > Hi all, is it possible to hide individual tabs in a tab layout? > > Ravi > — > “There are no dumb questions” - Carl Sagan > > -- > You received this message

Re: [Maya-Python] with open() fails if the path is passed as argument, but works if I passed as variable

2023-06-09 Thread Marcus Ottosson
treeWidget) You can modify the function call to remove the quotes: saveTreeDataToFile("D:/CHIMERA STUDIO/CHIMERA CGI/workspace/cfg_data.json", treeWidget) By removing the double quotes, the file path should be passed correctly, and the function should work as expected. On Fri, 9 Jun 2

Re: [Maya-Python] with open() fails if the path is passed as argument, but works if I passed as variable

2023-06-09 Thread Marcus Ottosson
Possibly unicode related, try print(repr(filePath)) and print(type(filePath)). Strings coming out of Qt is often unicode. Second possible cause is that there are “ included in the path, notice the triple ‘ on the invalid argument warning. On Fri, 9 Jun 2023 at 15:41, Rudi Hammad wrote: > hi, >

Re: [Maya-Python] Pymel Menu won't autoload Maya 2024

2023-05-19 Thread Marcus Ottosson
Could it be a problem of your script running before Maya is initialised? If you cmds.evalDeferred(make_the_menu) then that would let Maya do its dance before your script kicks in. On Fri, 19 May 2023 at 00:01, Justin Israel wrote: > > > On Thu, May 18, 2023 at 5:46 AM A wrote: > >> Hey Folks,

Re: [Maya-Python] How to activate a node by name and refresh Node Properties UI in Mari 5.0 using Python script?

2023-05-13 Thread Marcus Ottosson
I'm not sure you got the right mailing list, this one is primarily for Maya and Python. On Thu, 11 May 2023 at 17:54, Eri wrote: > Hello everyone, > > I am trying to create a Python script in Mari 5.0 to activate a node in > the Node Graph window by its name and refresh the Node Properties UI

Re: [Maya-Python] PyMEL 1.3.0 Released

2023-04-17 Thread Marcus Ottosson
I know that pip installing is a bit less convenient Just adding my two cents to this on how it is not just a bit less convenient, but a complete killer in some cases; the cases that are most important from my perspective. Namely, external tools development. Take mGear for example. A general

Re: [Maya-Python] how to get the closest point to a gpucache.

2023-04-07 Thread Marcus Ottosson
ork for gpuCache data? > At moment it only works with polygon mesh. > is there a way to read gpuCache without importing it as a polygon mesh. > gpuCache is just way more interactive in the viewport compared to mesh. > once again thanks for sharing your knowledge. > > Joe > > > On Thu

Re: [Maya-Python] how to get the closest point to a gpucache.

2023-04-06 Thread Marcus Ottosson
It does the opposite. Any MFn* class is called a “function set”, and contains functions you can use for a particular type of Maya object. Like mesh-related functions in MFnMesh. But MPx* classes are things that you the developer implement to provide Maya with data. In this case, the closestPoint

Re: [Maya-Python] Maya 2024 pyMel ;(

2023-04-02 Thread Marcus Ottosson
: > The last tag was in Nov 2021 > Could it be that it's not actively maintained anymore so Autodesk stopped > bundling it? > > On Sun, 2 Apr 2023, 9:38 pm Marcus Ottosson, > wrote: > >> I've also tried getting to the bottom of why PyMEL stopped being included >>

Re: [Maya-Python] Maya 2024 pyMel ;(

2023-04-02 Thread Marcus Ottosson
I've also tried getting to the bottom of why PyMEL stopped being included to begin with in 2023, assuming I missed a conversation somewhere. But it appears to have happened out of the blue over at Autodesk headquarters? :O Maybe @Chad Dombrova knows more? On Sun, 2 Apr 2023 at 00:28, Justin

Re: [Maya-Python] Virtual environment: Maya23 and macOS ARM

2023-02-03 Thread Marcus Ottosson
Interesting, I was able to replicate this here too. I can see how venv may get confused; it’s being run via mayapy which itself is run under Rosetta 2 for x86 emulation. I would have expected venv to only reference things relative the Python it was called from, but as evident by the actual

Re: [Maya-Python] New Maya skin weight export/import tool: Skinner

2023-01-24 Thread Marcus Ottosson
t;>> >>>>>>> Thank you, >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Tue, Dec 7, 2021 at 2:27 PM AK Eric wrote: >>>>>>> >>

Re: [Maya-Python] Distribute spheres on ellipse pattern with python

2022-10-10 Thread Marcus Ottosson
> The only issue I have is that it doesn't evenly distribute the spheres along the ellipse, maybe that's not easy to accomplish? Got an interesting thought-experiment for you. :) What would it look like to only distribute 3 or 4 spheres in an ellipse, with even spacing? Pen and paper is allowed.

Re: [Maya-Python] python with maya batch

2022-09-28 Thread Marcus Ottosson
written into separate batch >> commands into new bat file that runs after creation. and to this step I >> need to assign python commands with arguments. >> >> this is working I use it just I use mel as mid step >> >> I just need to get the right syntax >> -

Re: [Maya-Python] python with maya batch

2022-09-26 Thread Marcus Ottosson
If I was you, I’d turn that around. 1. Run script 2. Script opens file For example. *fixIt.py* # Gain access to maya.cmdsfrom maya import standalone standalone.initialize() # Use maya.cmds to do magicfrom maya import cmds cmds.file("d:/test.ma", open=True) print("Fixing it") That you

Re: [Maya-Python] Re: Help to customize the Maya

2022-09-26 Thread Marcus Ottosson
For perspective, and because I was curious, Blender 3.1 took 6 seconds on the same machine; I don't normally use it and have nothing but a vanilla install, so it's not an apple-to-apple comparison. But I've always found it quicker than Maya, that's for sure. On Mon, 26 Sept 2022 at 18:18, Marcus

Re: [Maya-Python] Re: Help to customize the Maya

2022-09-26 Thread Marcus Ottosson
Plug-ins won't affect startup time, but would affect how long it takes for Maya to become responsive once it's started up. First thing it does once the GUI has become visible is to load that list of plug-ins in the manager. So the less you have there, the quicker you'll be able to dive in. Other

Re: [Maya-Python] Re: mirror nurbsCurve in Maya

2022-09-26 Thread Marcus Ottosson
I think OP specifically asked for a way that did *not* involve duplicating and scaling. The Maya API has some options, in a nutshell: 1. Read points on original curve 2. Negate their x coordinate 3. Generate a new curve using the negated points import cmdx # Read original points

Re: [Maya-Python] PySide2 undo/redo inside Maya

2022-09-23 Thread Marcus Ottosson
You’ve got the right idea, but I’m not sure what you expect is what your users would expect? Am I understanding it correctly that a user would: 1. Open your UI 2. Click a button 3. Think for a moment.. 4. Click another button 5. Check their phone.. 6. Click a third button 7.

Re: [Maya-Python] Python Loop Speed Performance Question & C++ MPxCommand Question

2022-09-23 Thread Marcus Ottosson
Oh, yes you are. My mistake, I'll need to adjust my glasses before replying.  On Friday, 23 September 2022 at 08:17:07 UTC+1 cds...@gmail.com wrote: > hello > I'm already using from maya.api import OpenMaya. > So should I use from maya import OpenMaya? > Is it 1.0 > 2.0? > > 2022년 9월 23일 금요일

Re: [Maya-Python] Python Loop Speed Performance Question & C++ MPxCommand Question

2022-09-23 Thread Marcus Ottosson
Thanks, the first potential optimisation I can spot is the use of Maya API 1.0. I would take 2.0 for a spin also - i.e. from maya.api import OpenMaya - I would expect either a small or major improvement, since there is less serialisation going on between Python and C++ in 2.0. On Fri, 23 Sept

Re: [Maya-Python] Python Loop Speed Performance Question & C++ MPxCommand Question

2022-09-23 Thread Marcus Ottosson
Hello! I can shed some light on these. I tried to work the Python Loop part with C++ MPxCommand, but I couldn’t find a way to return data by executing the Arguments in the form of Float3Array (Point Positions) and the corresponding command. (Return : IntArray) If you are certain that looping

Re: [Maya-Python] Select objects after import

2022-07-31 Thread Marcus Ottosson
in that namespace, atho this one is not as neat! >> >> On Sun, 31 Jul 2022, 12:03 Marcus Ottosson, wrote: >> >>> Unsure whether this’ll work with all file formats, but for native Maya >>> files there’s the returnNewNodes argument for cmds.file(), you can pass >&

Re: [Maya-Python] Select objects after import

2022-07-31 Thread Marcus Ottosson
Unsure whether this’ll work with all file formats, but for native Maya files there’s the returnNewNodes argument for cmds.file(), you can pass that to cmds.select(). - https://help.autodesk.com/cloudhelp/2020/ENU/Maya-Tech-Docs/CommandsPython/file.html#flagreturnNewNodes On Sun, 31 Jul

Re: [Maya-Python] dagMenuProc

2022-07-26 Thread Marcus Ottosson
I can right-click + drag in Object Mode with Maya 2023 on Windows. Unclear what or why you're seeing that error. A bad install? Bad user permissions on files where it's installed? On Tuesday, 26 July 2022 at 07:24:53 UTC+1 Justin Israel wrote: > > > On Tue, 26 Jul 2022, 6:08 pm Sridhar M,

[Maya-Python] Re: Widgets in maya viewport

2022-07-19 Thread Marcus Ottosson
at 14:46:22 UTC+1 Daniele Dolci wrote: > Hi All! > > I am playing around in Maya trying to achieve a UI similar to the one > implemented in Ragdoll by Marcus Ottosson. I have a couple of questions. > The first is probably going to be trivial: How do I make the background o

Re: [Maya-Python] MTimer?

2022-07-15 Thread Marcus Ottosson
Have a look at PySide2.QtCore.QTimer. Once destroyed, it will stop calling your function. On Fri, 15 Jul 2022 at 03:22, João Victor wrote: > Hi, > > Sorry for the simple question, but I am trying to find a way to make it > work without success. > How I can run a function every x seconds when an

Re: [Maya-Python] Convert Path String To Module Name

2022-06-08 Thread Marcus Ottosson
Almost got it! rig = rig_mod.rig That’s because the module was already imported in the line above, but cannot use the from ... syntax since that would try and import it again. Your rig_mod is a perfectly fine imported module. On Wed, 8 Jun 2022 at 17:28, Anas Elkinawy wrote: > Is there any

Re: [Maya-Python] Gravity NOT working

2022-02-01 Thread Marcus Ottosson
I put together a Bullet example for you, and then realised you were using the system prior to Bullet being introduced to Maya, so I’ll post both examples for future readers. So I think you’re doing it right, at least it appears to be designed for use in this way. If so, it isn’t doing what it’s

[Maya-Python] Re: non-referenceable nodes

2022-02-01 Thread Marcus Ottosson
I suspect you'll need to come at the problem from the other end; of only *exporting* the nodes you want to be referenced later. There is no way, to my knowledge, to selectively reference a file. The one exception being a reference with another reference inside of it; so potentially if you

Re: [Maya-Python] event + button click

2022-01-13 Thread Marcus Ottosson
Try getting the modifier state from here. - https://doc.qt.io/qt-5/qguiapplication.html#keyboardModifiers modifiers = QtWidgets.QApplication.keyboardModifiers() if modifiers & QtCore.Qt.ControlModifier: print("Ctrl was held") if

[Maya-Python] Re: aniMeta - simple rigging tools

2022-01-11 Thread Marcus Ottosson
gt; smooth weights tool alone already makes it worth having around. > > I know there isn`t any info about usage of aniMeta yet. But I am in the > process of putting info stuff together so people can get a more specific > idea of what it is and how to use it. But so far thanks for your inte

[Maya-Python] Re: Maya 2022 immediate crash after launching through batch file

2022-01-11 Thread Marcus Ottosson
QT_PREFERRED_BINDING is related to Qt.py - https://github.com/mottosso/Qt.py#override-preferred-choice If it's set to PyQt4 or Pyside (not 2) that could maybe be problematic. On Tuesday, 11 January 2022 at 12:26:32 UTC Benjam901 wrote: > Our entire pipe from start to end is python 3. > > I

[Maya-Python] Re: aniMeta - simple rigging tools

2022-01-11 Thread Marcus Ottosson
Very exciting. :) I'm familiar with your work on Character Modular System, years ago from Suntoucher Labs. That stuff was next-gen. Keen to dive into this. One question comes to mind from your feature summary above, what are your thoughts on HumanIK? Is it intended for use by animators, or is

Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2022-01-02 Thread Marcus Ottosson
> hmmm...I guess there is no alternative way to complile plugins for mac from windows? Your only option is to build on MacOS, either on a real Mac, a "Hackintosh" or a virtual machine. There is no way to compile a Maya plug-in for Mac using anything but MacOS. The same goes for all platforms.

Re: [Maya-Python] MPxDeformer::deform() triggering MPxLocatorNode::draw() at runtime

2021-12-23 Thread Marcus Ottosson
former/locator into a single command is what I had in mind >> (that's how we were working in a previous studio where I was doing RnD), >> but I had no idea deleting nodes on disconnection was something the user >> had control over! Do you remember which command is involved in this &

Re: [Maya-Python] MPxDeformer::deform() triggering MPxLocatorNode::draw() at runtime

2021-12-14 Thread Marcus Ottosson
Happy to see it coming in handy xD Not sure how you found it though, maybe Google? I can’t help you with MPxLocatorNode::draw other than to say “don’t use it”. That’s Legacy Viewport stuff. If you absolutely have to use it - some are still stuck on Legacy Viewport unfortunately - then read no

Re: [Maya-Python] Cloud Native Studios discord invite

2021-12-09 Thread Marcus Ottosson
Cheers, mate. Is there any Maya groups I can join? Here’s one that has both Maya and Python channels. - https://discord.gg/8KRhtePS9m (called “Ask a Rigger”) Thanks to Remi for letting me share an invite link (that does no expire :) ​ On Wednesday, 8 December 2021 at 21:18:37 UTC Justin

Re: [Maya-Python] New Maya skin weight export/import tool: Skinner

2021-12-02 Thread Marcus Ottosson
Congrats on making it to a public release, that stuff is hard! I was typing up a few questions, especially on comparisons with ngSkinTools, but as I did I came across the answers in your README already. :D My one suggestion would be to include a gif near the top of your README, using your tool in

Re: [Maya-Python] System running scripts from two different Maya and Houdini interpreters

2021-11-22 Thread Marcus Ottosson
by > file name is not supported. > > > > Em sábado, 20 de novembro de 2021 às 08:05:51 UTC-3, Marcus Ottosson > escreveu: > >> I wonder whether wires have been crossed, and that the question isn’t >> about accessing Maya and Houdini libraries from one process, but one

Re: [Maya-Python] System running scripts from two different Maya and Houdini interpreters

2021-11-20 Thread Marcus Ottosson
I wonder whether wires have been crossed, and that the question isn’t about accessing Maya and Houdini libraries from one process, but one process calling out to both Maya and Houdini? For example, is this what you want? import hou from maya import cmds cmds.displayWarning("I'm Maya, and

Re: [Maya-Python] accessing maya's interpreter globals from another scripts

2021-11-10 Thread Marcus Ottosson
Global variables are.. global, so anything present in `globals()` from one module is present in another. Are you seeing different results from `globals()` in `foo.py` versus Maya's interpreter (by which I assume you mean the Script Editor)? On Wed, 10 Nov 2021 at 09:36, Rudi Hammad wrote: >

Re: [Maya-Python] Re: possible maya bug with MPlug.setKeyable

2021-10-26 Thread Marcus Ottosson
ependencyNode(mobj) > mplug = mfnDepNode.findPlug("tx") > mplug.setKeyable(False) > > El martes, 26 de octubre de 2021 a las 7:41:52 UTC+2, Marcus Ottosson > escribió: > >> I was looking at this, but found it consistent across all versions of >> Maya, so I'm

Re: [Maya-Python] Re: possible maya bug with MPlug.setKeyable

2021-10-25 Thread Marcus Ottosson
I was looking at this, but found it consistent across all versions of Maya, so I'm not sure it qualifies as a bug. xD I even use it, to dynamically alter the Channel Box based on the value of another attribute, like if a node is disabled I can go ahead and hide other attributes that depend on this

Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2021-10-13 Thread Marcus Ottosson
Yes, that's not an issue. The version of Maya you build for is determined by the SDK you use, e.g. the Maya 2020 SDK for Maya 2020 plug-ins. The only thing to bear in mind is that the compiler version needs to match the Maya compiler version, so VS 2015 or 2019 for Maya 2018-2022. You can't build

Re: [Maya-Python] V Crypt System

2021-09-14 Thread Marcus Ottosson
gt;>>>>>>>> to >>>>>>>>>>>>> protect, if that is rigs and animation, the Maya scene format >>>>>>>>>>>>> should be >>>>>>>>>>>>> enough. >>>>>

Re: [Maya-Python] V Crypt System

2021-09-06 Thread Marcus Ottosson
where. > > And even this will not save you from attempt to try take this decrypted > data from RAM... > воскресенье, 5 сентября 2021 г. в 10:27:53 UTC+3, Marcus Ottosson: > >> I agree with you. This would not solve all problems with working >> remotely, but it would solve

Re: [Maya-Python] V Crypt System

2021-09-05 Thread Marcus Ottosson
gt; or not, it might be the solution to encrypt files and safely work as > freelance (specially for me since now I am full time freelancer) > > I'll keep you posted > > El sábado, 4 de septiembre de 2021 a las 22:59:06 UTC+2, > justin...@gmail.com escribió: > >> On Sun, Sep 5,

Re: [Maya-Python] V Crypt System

2021-09-04 Thread Marcus Ottosson
ou know you > recieve a file that is encrypted because you know you are in production > context. You can open it and work with it. It simply won't work outside you > computer. > El sábado, 4 de septiembre de 2021 a las 20:06:47 UTC+2, Marcus Ottosson > escribió: > >> To prote

Re: [Maya-Python] V Crypt System

2021-09-04 Thread Marcus Ottosson
To protect the contents of a Maya file? Typically protection would involve software, like Python source, but you mean to protect like a model or some animation? At that point, why wouldn’t you just hold onto the file, and not send it or make it publicly available? Maybe you have a particualr

Re: [Maya-Python] is it possible to not show the error --> # Error: Non-deletable node

2021-08-22 Thread Marcus Ottosson
My first go-to would be to try cmds.file(new=True, force=True) instead of cmds.delete(), does that work for you? On Sun, 22 Aug 2021 at 03:09, Rudi Hammad wrote: > Hi, > this might seem an odd question, but I was wondering if it is possible to > make maya's IDE not showing the error message

Re: [Maya-Python] userScript.py is not being executed

2021-08-17 Thread Marcus Ottosson
Try this. from maya import cmds def functionA(): varA = False def delayMe(): cmds.scriptJob(event = ["SceneOpened", functionA]) cmds.evalDeferred(delayMe) By “evaling” something “deferred” you delay having something called until Maya is loaded up, UI and all. Also don’t forget to

Re: [Maya-Python] Optimising scene

2021-08-17 Thread Marcus Ottosson
interactivity? Render >> time? Animation interactivity? >> What do you have in the scene - is it environment, is it includes heavy >> rigs, and so on. >> Please provide more information about the problem for us to try to help >> you. >> >> вторник, 17 августа 20

Re: [Maya-Python] Optimising scene

2021-08-17 Thread Marcus Ottosson
Great question, but vague question. Optimise for what? Performance? Disk space? Memory? Marketability? Ease of use? Monetary value? Maximum Facebook friends? Some of those you can achieve with Python. On Tue, 17 Aug 2021 at 14:42, Nirmal Kumar wrote: > Hello everyone , > What are all the

Re: [Maya-Python] hugh ik solver maya bug?

2021-08-14 Thread Marcus Ottosson
I got curious and had a look in 2019. It’s a UI issue. [image: ikwrong2] Notice how I selected that second joint chain, but am still affecting the first? Bug bug bug. [image: ikfix] Here it’s “fixed” by copying the AE. Notice how both AEs tell me it’s editing the same node, ikHandle3. When

Re: [Maya-Python] make attribute not keyable

2021-07-26 Thread Marcus Ottosson
; to actually be un-keyable for years.. ( > maybe even a decade?) > > I'm not exactly sure what the reasoning behind allowing un-keyable > channels to still be keyed is. > > -=s > > On Mon, Jul 26, 2021 at 3:35 AM Marcus Ottosson > wrote: > >> The solution wh

Re: [Maya-Python] make attribute not keyable

2021-07-26 Thread Marcus Ottosson
static variable and that's > why it propagates through each new node that is created? we'll need to be > careful to set back to True. > > Interesting stuff... > > > El domingo, 25 de julio de 2021 a las 20:41:15 UTC+2, Marcus Ottosson > escribió: > >> Yes, the jargon here

Re: [Maya-Python] make attribute not keyable

2021-07-25 Thread Marcus Ottosson
Yes, the jargon here is terrible. Likely for legacy reasons. (Although I can’t think of which ones exactly? I remember this being fuzzy way back in Maya 4.0) But, it isn’t true that the s hotkey puts a key on non-keyable attributes, can you confirm? 1. Create cube 2. Make translateY,

Re: [Maya-Python] OpenMaya MFnTransform setScale() issue

2021-07-16 Thread Marcus Ottosson
A matrix cannot accurately represent a negative scale along an arbitrary axis. The information along which axis you scale is lost during the conversion from transform into a matrix. The resulting worldspace matrix will be correct, but they may have different decomposed scale (and rotate) values.

Re: [Maya-Python] System of References Maya

2021-07-08 Thread Marcus Ottosson
Not sure I understand; can you add some examples of what you are seeing and what you expect to see? On Thu, 8 Jul 2021 at 01:53, Totally Zen wrote: > how to solve maya's frame of reference is quite confusing? > some he adds RN, why? > others he adds numbers, why? > I see he plays his way,

Re: [Maya-Python] Adding custom deformer to a skinned mesh

2021-07-05 Thread Marcus Ottosson
Cycle warnings come from the way nodes are connected, rather than the API (assuming you mean maya.api.OpenMaya or the C++ API?). The warning means that one or more *output* attributes in your plug-in is causing one or more of the of the *input* attributes to evaluate. For example, if the

Re: [Maya-Python] Using MArrayDataBuilder in python API 2.0

2021-07-03 Thread Marcus Ottosson
I want to connect to, say > outPoints[3].outPointsX - then I think compound attributes are my only > choice. > > On Friday, July 2, 2021 at 11:30:24 AM UTC+2 Marcus Ottosson wrote: > >> Compound attributes always makes life hard. Does it behave any different >> with plain float

Re: [Maya-Python] Using MArrayDataBuilder in python API 2.0

2021-07-02 Thread Marcus Ottosson
Compound attributes always makes life hard. Does it behave any different with plain float attributes? I.e. can the problem be isolated to the compound attributes? On Fri, 2 Jul 2021 at 10:01, f.mi...@gmail.com wrote: > I need a simple DG node that uses connected mesh and copies vertex >

Re: [Maya-Python] Call back when playback gets to the end of the timeline

2021-06-29 Thread Marcus Ottosson
Try replacing if [Current Frame == Last timeline frame] with if [Current Frame < Last Frame]. That way, whenever it rewinds, regardless of the last frame, you’ll know. On Tue, 29 Jun 2021 at 07:42, Andres Felipe wrote: > *Scenario:* > Building a custom Sequencer in Maya. I need to get a

Re: [Maya-Python] C++ api issue

2021-06-24 Thread Marcus Ottosson
Looks like poseDriver is added twice. cmpAttr.addChild(poseDriver); cmpAttr.addChild(poseDriver); Don’t forget to check the status after each call. It’ll tell you when any of them fails, which in this case is likely the second call to adding poseDriver. On Fri, 25 Jun 2021 at 05:53,

Re: [Maya-Python] A good way to store mesh components in a set ?

2021-06-18 Thread Marcus Ottosson
wrote: > I made a few tests on the usual number of elements, 2k / 1k, and it goes > smoothly, not bad! > > Thanks a lot Marcus :) > > On Friday, June 18, 2021 at 9:42:35 a.m. UTC-4 Marcus Ottosson wrote: > >> You tell me. How long does it take currently? How often do you i

Re: [Maya-Python] A good way to store mesh components in a set ?

2021-06-18 Thread Marcus Ottosson
n 1k objects, do you think it's not needed in this case ? > > > On Friday, June 18, 2021 at 3:01:43 a.m. UTC-4 Marcus Ottosson wrote: > >> Something like this should have you covered. >> >> for mesh in cmds.ls(selection=True, type="mesh"): >> cm

Re: [Maya-Python] A good way to store mesh components in a set ?

2021-06-18 Thread Marcus Ottosson
Something like this should have you covered. for mesh in cmds.ls(selection=True, type="mesh"): cmds.select("%s.f[0:]" % mesh) cmds.sets(name="%s_set" % mesh) The .f[] syntax is for selecting faces, it’s what you see echoed in the Script Editor as you select a face interactively via the

Re: [Maya-Python] Shader texture file not found

2021-06-15 Thread Marcus Ottosson
Hi Anastasia, welcome to the forum! In Python, the \ character is a special character for escaping other characters. E.g. \n means “newline”. In your example, the \ is used in your path: file1 = ("C:\Users\User\Download\swatch_arles-yellow__6094-42.png") You can either keep it, and prepend a r

Re: [Maya-Python] which units do you use in your productions?

2021-06-02 Thread Marcus Ottosson
In my experience there is no right answer, it all depends. :( Like you mentioned, for *some* grooming tools, real-world scale is preferred. But even that depends on whether the tools themselves where designed around it, which isn’t necessarily the case. Rendering typically assumes real-world

Re: [Maya-Python] Re: News: Additional Manager for Group

2021-06-01 Thread Marcus Ottosson
I'm also happy that Marcus has accepted =] >>>> Thank you both for the priceless work done here! >>>> >>>> Le mardi 1 juin 2021 à 14:50:59 UTC-4, justin...@gmail.com a écrit : >>>> >>>>> Hi Everyone! >>>>> >>>>&

Re: [Maya-Python] accurate bezier curve fitting

2021-06-01 Thread Marcus Ottosson
Would it be possible to post the results you weren't happy with, along with the results in Maya you thought gave better results? On Tue, 1 Jun 2021 at 14:24, Alok Gandhi wrote: > This might be a useful read maybe? > https://raphlinus.github.io/curves/2021/03/11/bezier-fitting.html > > On Tue,

Re: [Maya-Python] Desperately trying to run matplotlib

2021-05-24 Thread Marcus Ottosson
e: > here's the best I managed > https://gist.github.com/yetigit/c2f55bdb8b1798b2936687567f9c6c1e > > On Monday, May 24, 2021 at 1:59:52 PM UTC+2 Marcus Ottosson wrote: > >> Could you post some of those error messages? Maybe someone here >> recognises and could help res

Re: [Maya-Python] Desperately trying to run matplotlib

2021-05-24 Thread Marcus Ottosson
er > > On Monday, May 24, 2021 at 9:41:44 AM UTC+2 Marcus Ottosson wrote: > >> This topic is so common it really needs to be highlighted somewhere. >> Maybe as a new Maya splash screen? xD >> >> [image: notcompatible] >> >> The problem though is that

Re: [Maya-Python] Desperately trying to run matplotlib

2021-05-24 Thread Marcus Ottosson
This topic is so common it really needs to be highlighted somewhere. Maybe as a new Maya splash screen? xD [image: notcompatible] The problem though is that many packages *are* compatible, it’s only the compiled packages that are not. So it’s understandable that it keeps getting confused. Can

Re: [Maya-Python] maya API ?? reading an external json file

2021-05-23 Thread Marcus Ottosson
gt; > > So the issue : when I set the file, it doesnt run the compute at all. it > will only run compute when one of the other attrs is changed. What > should I do to get it to run when the file is updated or set? > > On Tue, May 18, 2021 at 12:29 PM Justin Israel > wrote:

Re: [Maya-Python] maya API ?? reading an external json file

2021-05-18 Thread Marcus Ottosson
; Thanks Marcus, >>>> the txt file will be just a bunch of values and matrices ... it might >>>> be binary it might be ascii..not 100% yet, depends how big the files >>>> get. was leaning towards JSon for easy of use/setup >>>> the python Q was purely

Re: [Maya-Python] maya API ?? reading an external json file

2021-05-18 Thread Marcus Ottosson
what would I use to allow the plugin to read an external user specified file, either a txt or json? You could make a string attribute on the node, and set MFnAttribute::isUsedAsFilename = true

Re: [Maya-Python] Creating .bat file (launcher) for maya

2021-05-07 Thread Marcus Ottosson
I doubt you’d need a tutorial, what are you looking for the bat to do? Here’s an example, along with a few environment variables. - https://github.com/mottosso/Maya-Environment-Variables *maya2020.bat* @echo off set MAYA_DISABLE_CIP=1set MAYA_DISABLE_CER=1set MAYA_DISABLE_CLIC_IPM=1 ::

Re: [Maya-Python] Maya 2022 and output windows

2021-05-06 Thread Marcus Ottosson
I recently asked this very same question on the Autodesk forums, and yes, the solution is to simply call flush() afterwards. :D sys.__stdout__.write("Hello world!") sys.__stdout__.flush() It’s available and harmless in Python 2 as well. -

Re: [Maya-Python] numpy errors fixed when reintializing maya

2021-05-01 Thread Marcus Ottosson
I would not rule out any memory issues. Keep an eye on the >> memory next time it happens. >> >> On Sat, May 1, 2021, 00:04 Marcus Ottosson wrote: >> >>> Did you happen to get NumPy from PyPI, via pip install? There was a >>> thread here about it not long ago, but the b

Re: [Maya-Python] numpy errors fixed when reintializing maya

2021-04-30 Thread Marcus Ottosson
Did you happen to get NumPy from PyPI, via pip install? There was a thread here about it not long ago, but the bottom line is if you haven’t got a version compiled specifically for your version of Maya, it won’t behave. On Fri, 30 Apr 2021 at 18:20, Rudi Hammad wrote: > I'll let you know when

[Maya-Python] Ctrl + P

2021-04-09 Thread Marcus Ottosson
Sorry for the cryptic title, but this has eluded me for years and I can never remember the hotkey for this hidden but surprisingly useful little widget that pops up in Maya whenever you hit Ctrl + P when I actually need it. So there, crystallised and written into the stone that is the internets.

Re: [Maya-Python] Re: [PySide] Parenting a QWidget to a QTreeWidgetItem crashes

2021-04-07 Thread Marcus Ottosson
If I had any hair, I would have been pulling it out if it wasn’t for this post. Thank you from the future! :D The minor difference was that I had to parent my QTreeWidgetItem to the QTreeWidget, and each child item to its parent item. Something I had assumed happened automatically when you add an

Re: [Maya-Python] C++ speed/efficiency in Maya

2021-04-05 Thread Marcus Ottosson
In many cases, MEL should be faster than pure python I thought so too! But to my great surprise, for a lot of common operations - like createNode, getAttr and setAttr - MEL was consisteny *significantly slower* than cmds. - https://github.com/mottosso/cmdx#timings These were done in Maya

Re: [Maya-Python] Maya VP2 Rendering engine

2021-04-05 Thread Marcus Ottosson
Not in my experience, but my understanding is that it's meant to for game developers whose shaders are written for DirectX. For when you want an exact replica of an asset between game engine (rendering with DirectX shaders) in Maya. I'd be surprised if you found a performance difference between

Re: [Maya-Python] Maya API 2.0 get vertices/faces faster?

2021-04-03 Thread Marcus Ottosson
times. >> converting with "polyListComponentConversion" takes too long. >> There is some way to get it, without having to convert? Or this is the >> only way? >> Im using API. >> thanks! >> >> Em sexta-feira, 2 de abril de 2021 às 1

  1   2   3   4   5   6   7   8   9   10   >