[Maya-Python] Re: Robust tools for skin weight export/import

2019-06-21 Thread Andres Weber
Funny enough I actually have written those helper scripts since it was pretty simple as their JSON files are quite well formatted. Honestly I never really looked further than ngSkinTools as they're the most complete and functional skinning toolset I've come across and used for many years.

[Maya-Python] Re: Ignoring case sensitivity?

2019-02-22 Thread Andres Weber
In theory you could make everything easier for you by lowercasing the entire queried string pre-parsing/checking. On Thursday, February 21, 2019 at 5:45:19 PM UTC-5, Francesco wrote: > > Hi Alberto! > > I tested it out and it works! Thank you so much!! I have a followup > question: what if the

Re: [Maya-Python] Wildcard to filter out some controllers from current selections

2018-10-06 Thread Andres Weber
The solution I'm going to suggest is probably a bit too brute force as it would be not using a lib for quicker or more elegant comparisons however something like: filtered = [selected for selected in selection if all([exclusion not in selected for exclusion in exclusions])] That would very

[Maya-Python] Re: PyCharm Auto Completion in Maya 2018 for QT5

2018-06-12 Thread Andres Weber
Yeah they recently moved it from it's normal download location on the actual autodesk app store to here: https://www.autodesk.com/developer-network/platform-technologies/maya?_ga=2.21243515.1545365283.1528834929-709237566.1528834929 You'll find the download links near the bottom of the page.

[Maya-Python] Re: Looking for feedback on Python Whiteboxing tool.

2018-05-30 Thread Andres Weber
What are some of the capabilities you're looking to expand upon? Is there a specific area of your code that you'd want to be investigated for stability/improvements or any specific issues you ran into during development? Is there a github page for it? On Saturday, May 26, 2018 at 7:21:52 AM

[Maya-Python] Re: maya 2017 development kit

2018-05-30 Thread Andres Weber
It recently moved to its own space here: https://www.autodesk.com/developer-network/platform-technologies/maya You'll see the download links down below near the bottom. I'm very happy about this change since it was pretty annoying to get something so trivial! On Wednesday, May 30, 2018 at

[Maya-Python] Re: Has anyone had success with setting up virtualenv with mayapy?

2018-03-08 Thread Andres Weber
I usually make a venv out of a matching Python version and then just inject the path into Mayapy...not what you're looking for I know but it was the compromise I found was easiest. On Thursday, March 8, 2018 at 3:09:22 PM UTC-5, Robert White wrote: > > The only time I've gotten virtualenv to

Re: [Maya-Python] runtime commands

2017-12-20 Thread Andres Weber
Whoa I didn't know about the runTimeCommand -q -command flags. Learn something new every day! On Wednesday, December 20, 2017 at 10:42:34 AM UTC-5, David Mwangi wrote: > > Thanks Tim, > > I will. I found a "brute force" workaround but I need to know what it > does. > > Thanks again. > > On

Re: [Maya-Python] hyphen

2017-12-09 Thread Andres Weber
Near the bottom of this PEP you'll see it and maybe it will clear up a few others you might not know about! https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles On Saturday, December 9, 2017 at 12:53:31 PM UTC-5, elrond79 wrote: > > Underscores at the start of a variable name are

[Maya-Python] Re: Select edges automatically

2017-12-07 Thread Andres Weber
It just depends on what you want to do and how you want to automate the selection (every nth edge, following a pattern, only edge loops, edge loop segments etc) To select multiple edges you can use slices: import maya.cmds as mc start_edge, end_edge = 1, 40 helix, helix_shape = mc.polyHelix()

[Maya-Python] Re: NEED HELP PLZ!!!

2017-12-07 Thread Andres Weber
Sounds like you might have corrupted your installation of Maya to be honest if it can't import the standalone module, but there's a lot more information I'd need to know before actually believing it. If you open maya, go to the script editor, open a python tab and then type: import maya import

[Maya-Python] Re: Weta Digital hiring DevOps position on my team

2017-11-29 Thread Andres Weber
Always appreciate these, I've forwarded it to some friends. On Wednesday, November 29, 2017 at 1:46:30 PM UTC-5, Justin Israel wrote: > > Hi All, > > Sorry to make this a second job post in such a short time but this one is > specifically on my own team, at Weta Digital in New Zealand. > >

[Maya-Python] Re: comparing two lists, to do something?

2017-10-11 Thread Andres Weber
y args > matches.append([locator,vray_shader_target]) > # We stored the matches in the format list(list(locator, shader)) so now > you can run through that list like this if you wanted to use it later: > for locator, vray_shader_target in matches: > print(locator, vray_shade

[Maya-Python] Re: comparing two lists, to do something?

2017-10-09 Thread Andres Weber
To do matching like this at a more basic level usually people do some sort of token within the name of each object that represents the object type. For example: target_locator target_shader target2_locator target2_shader something like that. This way you can do really quick string

[Maya-Python] Re: Help with simple Python script

2017-09-26 Thread Andres Weber
Something that will help you immensely is not to rely on Maya's current selection and the fact having your code only work with the current selection. That kind of information gets very hard to rely on as code gets more complicated. So what you need to do is actually store the return value

Re: [Maya-Python] scripting and progrming

2017-08-14 Thread Andres Weber
The thing that was always a grey area in my head is when you're coding your own C++ Maya deformer or something like that. In my mind that's programming since it is a compiled/built process that ends up in a plugin file...but that's always been the one I have a hard time discerning. In my

[Maya-Python] Re: How to add a callback to MC.warning to update commandLine1 QLineEdit background color ?

2017-07-27 Thread Andres Weber
I don't have an answer for the stylesheet issue which seems like an interesting formatting problem...however I found a workaround (that I haven't tested really) that does not involve stylesheets but keeps the existing stylesheet rules intact: app = QtWidgets.QApplication.instance() font =

[Maya-Python] Re: how to find all unloaded (unchecked) referenced files in maya ?

2017-07-23 Thread Andres Weber
Love how many ways Maya/Pymel includes to solve a problem! It's a bit more verbose and seems to have some paths it might not go down (did you find it was actually going to the error catching section?) but if it works for you, that's great. Just a tip, there's a few I could mention but this

[Maya-Python] Re: Get objects that are not uv

2017-07-20 Thread Andres Weber
There's probably a hundred ways to do this but here's one: import pymel.core as pm sel = pm.ls(sl=True) sel[0].getShape().getUVs() >>> ([], []) # This is empty/no UVs # Or you could do sel[0].getShape().map # or sel[0].map # Empty objects should just return something like (depending on object

[Maya-Python] Re: how to find all unloaded (unchecked) referenced files in maya ?

2017-07-18 Thread Andres Weber
This one liner seems to work unloaded_reference_files = [file for file in cmds.file(reference=True, q=True) if not cmds.referenceQuery(file, isLoaded=True)] On Tuesday, July 18, 2017 at 7:25:41 AM UTC-4, Neil Roche wrote: > > Off the top of my head I think the referenceQuery command will only

Re: [Maya-Python] Hotlist - LAKKI LLC || Java, Project Manager, QA

2017-06-09 Thread Andres Weber
Finally, consulting we Maya Python users can count on. On Friday, June 9, 2017 at 2:22:16 PM UTC-4, Marcus Ottosson wrote: > > You haven't!? We're all having a good time here, don't miss out! > > On 9 Jun 2017 19:05, "Ravi Jagannadhan" > wrote: > >> Anyone called that phone

Re: [Maya-Python] Creating a curve-based wireframe

2017-06-01 Thread Andres Weber
Okay so there's lots of things wrong with this code. I'll start with the fact that every single call to selection (with the replace flag) updates your viewport and slows down your operation due to a screen refresh. Secondly there's lots of redundant work with lists going on. Lastly pymel is

Re: [Maya-Python] Re: Assign vertex color based on its position

2017-05-02 Thread Andres Weber
ing method setVertexColors() > <http://help.autodesk.com/cloudhelp/2016/ENU/Maya-SDK/cpp_ref/class_m_fn_mesh.html#ac87fe328d734133476d0ae30796c7400> > instead. > > So you could build the color and vertex arrays up front, and then make one > call to set the colors. > > &g

[Maya-Python] Re: Finding and selecting fliiped (red-colored) UVs

2017-05-01 Thread Andres Weber
A bit of a tricky one: Go to Layout UVs [Option box]: 1. Toggle Shell Layout: None 2. Toggle Rotate None 3. Toggle Scale Mode: None 4. Toggle on Flip reversed Now hit Layout UVs and it should flip and reversed UVs without affecting the current UV layout except for the flipped sections. On

[Maya-Python] Re: how many lines per function

2017-04-27 Thread Andres Weber
Just to add onto this topic: you'll find that many ways that you're thinking about doing things have been codified already into design patterns that might be more effective or efficient at getting the job done while maximizing reusable code that isn't brittle or hard to recycle/monolithic. It

[Maya-Python] Re: [MAYA MEL PYTHON] simple variable question

2017-04-23 Thread Andres Weber
Is PL_ also supposed to be a string? Seems like you just missed your quotation marks at the beginning and post string that surround the arguments. Also...I'd recommend not hard baking these sorts of things in, but passing as an argument... Aka: lookThroughModelPanel ("PL_" + $SceneName +

[Maya-Python] Re: PYTHON MAYA convert string u'001' to 001?

2017-04-17 Thread Andres Weber
You could also just cast to a string using str() around your EpisodeName but honestly the removal of back ticks makes more sense (in the future if you ever find you can't remove the leading 'u' otherwise). Also since you're already using the os module you should be using os.path.join instead

Re: [Maya-Python] closestPointOnPoly

2017-03-14 Thread Andres Weber
Sorry, just realized you're using API 1.0. I doubt that helps your situation and I can't recall the differences in those calls. On Wednesday, March 15, 2017 at 12:16:31 AM UTC-4, Andres Weber wrote: > > I commented on your gist but I'll add here just in case you don't check > t

Re: [Maya-Python] closestPointOnPoly

2017-03-14 Thread Andres Weber
I commented on your gist but I'll add here just in case you don't check that often: The problem with this code is specifying your world space as a string value. It requires an integer and for maximum future proofing you should use the pre-defined one from the api: OpenMaya.MSpace.kWorld Feed

[Maya-Python] Re: Code Completion for Maya 2017/PyCharm CE 2016.3.2

2017-03-06 Thread Andres Weber
still runs so...unless anyone knows why this is a horrible idea I'm going to consider this complete... On Monday, March 6, 2017 at 7:01:16 PM UTC-5, Andres Weber wrote: > > Hey Everyone, > > So I recently have been trying to collect and compile information on > setting up PyCharm p

[Maya-Python] Code Completion for Maya 2017/PyCharm CE 2016.3.2

2017-03-06 Thread Andres Weber
Hey Everyone, So I recently have been trying to collect and compile information on setting up PyCharm properly for use as an IDE for Maya. This is all well and good and the instructions are fine, however currently when trying to get the code completion working it doesn't seem to be

[Maya-Python] Re: kInvalidParameter except catching

2017-03-01 Thread Andres Weber
ealised my mistake, I didn't need to catch it anymore. > > On Thursday, 2 March 2017 08:52:27 UTC+11, Andres Weber wrote: >> >> So I have been trying to google it to no avail...probably just haven't >> figured out the magical one word I haven't thought of, but I was trying t

[Maya-Python] kInvalidParameter except catching

2017-03-01 Thread Andres Weber
So I have been trying to google it to no avail...probably just haven't figured out the magical one word I haven't thought of, but I was trying to write some API 2.0 code and couldn't figure out how to catch kInvalidParameter errors properly instead of just doing broad excepts which are

[Maya-Python] Simulate Attribute Editor Button Press (or workaround)

2016-08-01 Thread Andres Weber
Hey guys, Tough one to search on the list since I'm not sure of the right way to put it...but I was trying to setup a button that would toggle shaders to "Generate Preview" for UDIM textures. I wasn't able to finalize exactly what the command is that the button is running since echo all

[Maya-Python] Re: when to use 'is not' and !=

2016-07-25 Thread Andres Weber
Pretty succinct explanation over here which covers it nicely. Mainly one is just actual equality versus class/instance identity. Try not to use is not for things where you're trying to compare direct values. http://stackoverflow.com/questions/2209755/python-operation-vs-is-not On Monday,

Re: [Maya-Python] Tox Unittests

2016-07-13 Thread Andres Weber
Oh man I didn't know there was a container for this. Thanks Marcus, this is gonna save me a lot of time! On Wednesday, July 13, 2016 at 8:11:45 AM UTC-4, Cesar Saez wrote: > > I would like to point out that while Marcus suggestion is totally valid, > docker is not absolutely necessary to run

Re: [Maya-Python] Re: Accessing Film Gate / Film Back attribute

2016-06-23 Thread Andres Weber
I'm assuming Format is a custom class that you've created? In either case what Cesar mentioned is still applicable in this instance. You need to hardcore a look up dictionary based on the format names for each preset film back: format_lookup_table = {'16mm Theatrical': [0.404, 0.295],

[Maya-Python] Re: Accessing Film Gate / Film Back attribute

2016-06-21 Thread Andres Weber
I'm not sure I understand you right in regards to the delivery/default thing...but accessing film back is easy: *cmds:* import maya.cmds as cmds cmds.getAttr("myCameraShape.horizontalFilmAperture") cmds.getAttr("myCameraShape.verticalFilmAperture") *pymel:*

Re: [Maya-Python] am I using instance variables right...(also link my showreel)

2016-06-08 Thread Andres Weber
Hi Rudi, Just because I believe I understand where those two confusion points were coming from (I'm a rigger myself): The stretchy IK flag to the "makeIK" method would make sense to keep as a flag (with either an if statement depending on the flag OR another additional method in your class

[Maya-Python] Re: Automate Arnold “Ass Export” options in python for Maya

2016-05-04 Thread Andres Weber
port. See the AtNodeEntry page of the Arnold API for the available node types. On Wednesday, May 4, 2016 at 3:52:40 PM UTC-4, Andres Weber wrote: > > I didn't test this at ALL but after reading the documentation and checking > out the API very briefly I think you could access the int values vi

[Maya-Python] Re: Automate Arnold “Ass Export” options in python for Maya

2016-05-04 Thread Andres Weber
ot;mask 8" etc. > Only logical way I can think of is check out each option individually and > figure out the digits for that export combination. > > On Wednesday, May 4, 2016 at 1:06:56 AM UTC+5:30, Andres Weber wrote: >> >> Forgive me if I'm misunderstanding what exactl

[Maya-Python] Re: Automate Arnold “Ass Export” options in python for Maya

2016-05-03 Thread Andres Weber
Forgive me if I'm misunderstanding what exactly you're looking to solve but it just seems like a string format? let's assume "buttons" is a dictionary with keys relating to the option name with the value of the given buttons in relation to the state that you mentioned in your GUI that you'd

Re: [Maya-Python] Get the current render for each render layer

2016-03-08 Thread Andres Weber
Oh and sorry, I forgot to point out that this is ONLY in the case that you've created layer overrides per render layer (which is what I figured you did since you'd just simply check defaultRenderGlobals.currentRenderer otherwise). On Tuesday, March 8, 2016 at 2:53:32 PM UTC-5, Andres Weber

Re: [Maya-Python] how should I mirror joints?

2016-01-20 Thread Andres Weber
Also on top of what Marcus is saying (which is all GOLD you should be paying good attention to) I would like to mention that as you abstract all of these rigging processes, you get greater extensibility on your rigs with the ability to "plug and play" modules of control setups/styles and to be

Re: [Maya-Python] Re: Setting Display Type

2015-01-22 Thread Andres Weber
You've piqued my interest now if there's another (seemingly simple) way of doing it without doing some API sort of stuff for draw calls/shaders etc. Do you have a link to the rig? On Thursday, January 22, 2015 at 4:01:01 AM UTC-5, Marcus Ottosson wrote: If you click on the controller with

Re: [Maya-Python] Setting Display Type

2015-01-21 Thread Andres Weber
From my understanding you HAVE to have overrideEnabled set on in order for it to pay attention to those settings. You can control that attribute just like any other by connecting your display override attribute to it with an SDK (or some node combination of your own) to control it however you

[Maya-Python] Re: component islands

2014-09-19 Thread Andres Weber
This is the code I wrote a little while ago for getting component islands/shells...it's not the most efficient but it works. Oh well... Aside from that you could just cheat and create a cluster based on those verts and use that. or replace it with a locator after. def getShells(objs):

[Maya-Python] Re: Tentacle rig, drive transform with noise

2014-09-08 Thread Andres Weber
I've actually been looking for a solution to this myself. You can always use expressions or plugins, but I'm not sure about how to do it purely with nodes. openMaya way of doing it http://mayastation.typepad.com/maya-station/2011/03/how-to-sample-a-3d-texture.html Soup can do it with

Re: [Maya-Python] pyMel method for listing selected channelbox attributes

2014-06-10 Thread Andres Weber
Also: https://groups.google.com/forum/#!topic/python_inside_maya/ZhEQ76eQ7pc On Monday, June 9, 2014 9:01:24 PM UTC-4, Brian Eyre wrote: Thanks Kurian, Works a treat :-D On Monday, June 9, 2014 5:42:53 PM UTC-7, Kurian wrote: cmds.channelBox('mainChannelBox', q=True, sma=True) On Mon,

[Maya-Python] Re: Query primary joint axis

2014-05-29 Thread Andres Weber
(child, len=len+dist(obj,child)) lenJointChain(mc.ls(sl=True)[0]) Thanks. On Wednesday, May 28, 2014 5:15:12 PM UTC-4, Andres Weber wrote: I'm not really sure why you're doing it the way you're doing it... This is how I solved it quickly (There's better ways but I'm lazy and I

[Maya-Python] Re: Query primary joint axis

2014-05-28 Thread Andres Weber
I'm not really sure why you're doing it the way you're doing it... This is how I solved it quickly (There's better ways but I'm lazy and I didn't want to keep working on it.) Just a simple recursive function. def dist( objA, objB ): Ax, Ay, Az = objA.getTranslation(space=world) Bx, By,

[Maya-Python] Re: question about the uv transferring

2014-05-09 Thread Andres Weber
You could do a few things...if your rig is wonky and you cheated a bit to fit something in there then you can just make a new duplicate mesh, transfer the UVs to that and then delete history. Then match the binds between the two objects and transfer weights. Now delete your old mesh and your

[Maya-Python] Re: Towers of Hanoi

2014-04-28 Thread Andres Weber
Just gonna say a couple things that I noticed right off the bat (there's a TON of things wrong with this...but it's more of how it's organized that isn't necessarily great rather than syntax. First thing is: sourcePeg = [discList] should be sourcePeg = discList (then the two lists are the same

[Maya-Python] Re: Writing importer/exporter using Pymel

2013-12-19 Thread Andres Weber
import pymel.core as pm pm.fileDialog2 (or pm.fileDialog, but I'm pretty sure that's antiquated) Writing a plugin is actually deceivingly simple. There's TONS of tutorials online if you just google it. First thing I googled (not necessarily the best at all):

Re: [Maya-Python] Re: How to update corrective shapes when skin has been modified

2013-12-02 Thread Andres Weber
You might want to take a look at Chad Vernon's cvShapeInverter. It creates a node that updates correctives based on the basemesh+pose. I THINK this is what you're looking for but I may be wrong... http://www.chadvernon.com/blog/resources/cvshapeinverter/ On Monday, December 2, 2013 2:00:20 AM

[Maya-Python] Re: setattr not working for fileTextureName IF opened maya scene changed and saved in maya session. Works if file with modifications is opened in fresh maya session.

2013-10-24 Thread Andres Weber
I'm a little confused. I tried running your script and it most definitely didn't work (for more than a few reasons) but it seems like you're very confused about what functions to use and where. I've converted your script to PyMel (just to show, and also modified the cmds version). Seems

Re: [Maya-Python] Compare topology

2013-10-24 Thread Andres Weber
I'd also add a percentage for tolerance just in case the model is the same but ever so slightly changed. On Wednesday, October 23, 2013 12:40:18 AM UTC-4, Jakob Kousholt wrote: I'd also compare the UVs if the models has any. Sent from my iPhone On 23 Oct 2013, at 05:31, Jason Barnidge