script error - "Not Specific enough"

   3145   3   2
User Avatar
Member
77 posts
Joined: July 2005
Offline
I wrote a simple script to set all transforms to (0 0 0) for an object and all of its descendants.

I copied the traverse.cmd and modified it.

When I run it, I gen an error “not specific enough”.

The error is flagged on this line of code :

`run(“opparm $node t (0 0 0) r (0 0 0)”)`

“node” comes from -

.. set nodes = `run(“opglob *”)`
.. foreach node ( $nodes )
..


THIS line DOES work though :

set t = `run(“opparm -d $node t r”)`

The main difference seems to be when trying to *set* a parm vs *reading* it.

What's the syntax / technique to make this work ?,

I get the same error message when trying to pass the same commands to the ‘traverse.cmd’ script.

thx

Mike
User Avatar
Member
2199 posts
Joined: July 2005
Offline
try this

opcf /obj
foreach obj (`execute(“opglob @group1”)`)
opparm $obj t (0 0 0)
opcf ..
end
The trick is finding just the right hammer for every screw
User Avatar
Member
77 posts
Joined: July 2005
Offline
Simon
try this

opcf /obj
foreach obj (`execute(“opglob @group1”)`)
opparm $obj t (0 0 0)
opcf ..
end

Ok I got it to work.

Using opparm as a “bare” word seems to be the key.
(@group1 gave me an error .. no such group … and the “opcf ..” should
be outside the loop)

It's confusing and unclear in the docs as to when a command can be “bare”, or needs to be enclosed within an “execute”, or within backticks and an execute

thx

Mike
User Avatar
Member
2199 posts
Joined: July 2005
Offline
Sorry should have said replace group1 with your own group.
Sorry the opcf .. isn't required in this case, I was half thinking of a script that would go into each object and do something at sop level…. doh!
Should have checked it for you first, anyway you worked it out so that's good. :wink:
The trick is finding just the right hammer for every screw
  • Quick Links