Re: [Maya-Python] Re: Check all node types from a given full path

2018-09-13 Thread Marcus Ottosson
If I understand the goal, then something like this might work. from maya import cmds cmds.listRelatives("|group1", type="nurbsCurve", allDescendents=True) If there’s a nurbsCurve on any path starting with |group1, then this would return it. *Test scene* cmds.file(new=True, force=True) circle =

[Maya-Python] Re: How to set/ highlight QTreeView selection based on a given string

2018-09-13 Thread Michael Boon
You're calling set_selection before you call self.tree_view.setModel. I would guess that is the problem. Also I think you've missed "index" from the parameters you're passing to view.select() On Friday, 14 September 2018 09:25:40 UTC+10, kiteh wrote: > > I have the following QTreeView. > I am tr

[Maya-Python] How to set/ highlight QTreeView selection based on a given string

2018-09-13 Thread kiteh
I have the following QTreeView. I am trying to set the selection in the QTreeview based on the string I have derived - eg. '/users/Alice/people' and so the highlighted cell should only be 'people' that is listed under the Alice level. tree = { 'users': { "John" : ["graphics"], "Alice": [

Re: [Maya-Python] Issues with treeview and selections

2018-09-13 Thread kiteh
Thanks, I will take a look! -- 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

Re: [Maya-Python] Re: Check all node types from a given full path

2018-09-13 Thread yann19
Thank you all, I chanced upon a method and compiled the following code: def node_type_iteration(path_lists): for path in set(path_lists): current_object = cmds.listRelatives(path, parent = True, fullPath = True ) or [] while current_object: # Set the condition here

Re: [Maya-Python] Re: Check all node types from a given full path

2018-09-13 Thread Justin Israel
Assuming your selections list are proper full paths, what about something like this: selections = [ '|path|to|my|node', ] for node in set(selections): item = node while item: print item item = item.rsplit('|', 1)[0] On Fri, Sep 14, 2018 at 9:01 AM yann19 wrote: > Possible to do it not without

[Maya-Python] Re: Check all node types from a given full path

2018-09-13 Thread yann19
Possible to do it not without the use of pymel? -- 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...@googlegrou

[Maya-Python] Re: Check all node types from a given full path

2018-09-13 Thread Michael Kato
For this my preference would be using PyMel doing something like this import pymel.core as pm selections = pm.ls(sl=True) for node in set(selections): allParents = node.getAllParents() print allParents Hope that helps! On Thursday, September 13, 2018 at 1:21:24 PM UTC-7, yann19 wrote: >

[Maya-Python] Check all node types from a given full path

2018-09-13 Thread yann19
Hi all, What is the best way that I can break apart and check all the nodes within a given node's full path? I am trying to check the list of nodes within the path, and should the node/path fulfills a certain node type, it will stop iterating and store that selection.. So far I have tried the

[Maya-Python] Re: For loop that iterates over two lists

2018-09-13 Thread Chris Meyers
Just to follow up for any others that might see this that are still learning the basics like me. I ran into an issue with my original code that I posted above. Sometimes just selecting the set with cmds.select() it returns a list out of order. A post on highend3d provided the answer.ins

[Maya-Python] Re: For loop that iterates over two lists

2018-09-13 Thread Chris Meyers
So there really wasn't much to understand, it just worked perfectly. Thanks again to both of you! On Wednesday, September 12, 2018 at 5:49:09 PM UTC-4, Chris Meyers wrote: > > Thank you both for your replies. It will take me some time to actually > understand this but at least I know where to st