edits = cmds.referenceQuery('C:/cube{1}', failedEdits=True, successfulEdits=False, es=True)
First one finds the edits, second one finds nothing.
cheers
Mark
Been taking a look at the way getReferenceEdits works (as well as how
cmds.referenceQuery(es=1) works), and I think we're gonna need to
change it's behavior. Right now, what it returns just isn't very
useful.
To explain - there's basically two ways you can group refEdits in
relation to reference nodes - by what ref node they're stored on, and
by which objects they affect (and which ref node those objects are
'introduced' in). (These can be different reference nodes when
reference nodes are nested...) So, if you're querying a reference
node for it's ref edits, I can think of three possible results it
could return which you might consider 'useful':
1) All the refEdits which affects nodes introduced by it
2) All the refEdits stored on it
3) All the refEdits which affect nodes introduced by it, but stored on
the 'topReference' node
The first two are potentially useful for partioning; ie, if you
iterated over all the reference nodes in the scene, using either
methods 1 or 2, you'd end up with all the ref edits, grouped in some
sort of sane manner. The third is useful for getting the reference
edits which "make sense" in the context of a given scene (see the docs
on referenceQuery for only the edits on the topReference are the ones
you'll usually care about in a given scene).
Unfortunately, currently getReferenceEdits returns none of these -
instead, it returns the ref edits which affect the it's nodes, and are
stored on it. While this might seem appealing from a symmetry
standpoint, it's actually not very useful when the node is not it's
own 'topReference'. I really can't think of any situation in which
you'd be interested in that particular set of edits.
So, I think I'll probably alter the behavior of getReferenceEdits to
instead return #3.... at least by default - the ideal would be to have
flags to alter which set of edits is returned...
This would break backward compatibility for this command, but since I
can't imagine many people actually wanting the current behavior (as
Erkan's case illustrates), I don't think that will be a big issue.
Also - Erkan, haven't had a chance yet to look at your
changeEditTarget issue... if you could supply some sample code
illustrating a case where it's broken, it would help, though...
- Paul
2010/6/29 Erkan Özgür Yılmaz <eoyi...@gmail.com>:
by default, expressions are executed in relative namespace...
This is good thing because you can use hard coded node names in your
child file and reference the scene into another as many times as you
like and each expression will find its intended nodes.
This can be turned off with a line at the top of the expression
namespace -relative false
just so you know, at this point particle expressions are not by
default using relative namespaces
also, if you don't like using hard-coded names...
you can use the (node) keyword in an expression and you will be
returned the name of the expression node - with which you may do what
you like to get to the nodes you need - walking message connections
perhaps? (relative or not depending on which mode it is in at the
moment - this can be important if you need to put something in an
expression that is evalDeferred - since by the time it gets around to
executing it, you'll be back in root relative mode)