Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

suffix to an object error?

suffix to an object error?

jayantbhatt07
Advocate Advocate
1,437 Views
11 Replies
Message 1 of 12

suffix to an object error?

jayantbhatt07
Advocate
Advocate

Why this command is giving me an error 

 

(// Error: Line 2.46: Syntax error)

 

 

string $selObjs[] = ls -sl;
for( $obj in $selObjs ) group -name ( $obj + “_Ctrl” ) $obj;

0 Likes
Accepted solutions (2)
1,438 Views
11 Replies
Replies (11)
Message 2 of 12

mspeer
Consultant
Consultant
Accepted solution

Hi

 

 

string $selObjs[] = `ls -sl`;
for( $obj in $selObjs ) group -name ( $obj + "_Ctrl" ) $obj;
0 Likes
Message 3 of 12

g2m.agent
Collaborator
Collaborator
string $selObjs[] = `ls -sl`;
for( $obj in $selObjs ){
    group -name ( $obj + "_Ctrl" ) $obj;
} 

1. ls need to be surrounded by special markers. its the button under ESC.

2. _Ctrl must use the quotes of the English keyboard

0 Likes
Message 4 of 12

jayantbhatt07
Advocate
Advocate

Hi see the screenshot. I selected multiple objects and what this script does made a separate group for each object. It should make only one group for all the selected objects.

 

 

A1.PNGA2.PNG

0 Likes
Message 5 of 12

g2m.agent
Collaborator
Collaborator
Accepted solution
string $selObjs[] = `ls -sl`;
group -name ( $selObjs[0] + "_Ctrl" ) $selObjs;
0 Likes
Message 6 of 12

jayantbhatt07
Advocate
Advocate

Thank you so much for your help. 

 

 

I have one question I already asked on so many forums but looks like nobody has the answer I hope you have. Why we cant use the repeat command (#G ) with the same value which we used in the previous extrude ( Or action) I know we can copy and paste attributes but tha is pain in the head. Do you know any command for that?

 

@g2m.agent  @mspeer 

0 Likes
Message 7 of 12

mspeer
Consultant
Consultant

Hi!

 

Maya does this by default.

However if however you change values AFTER using the command, this will not be included for repeat.

0 Likes
Message 8 of 12

jayantbhatt07
Advocate
Advocate

Hi in my 1st extrude the value was 0.848 and after that when I hit G command all values are by default set to zero. Which is I dont want.

 

 mspeers1.PNGmspeers2.PNG

0 Likes
Message 9 of 12

mspeer
Consultant
Consultant

Hi!

 

This In-View Editor affects the values of the node in the history AFTER the command was already executed and the node created, it's a different interface than Attribute Editor, but comparable.

You can't reuse node edits for repeat.

0 Likes
Message 10 of 12

jayantbhatt07
Advocate
Advocate

Ok thank you so much for the info. 🙂

0 Likes
Message 11 of 12

g2m.agent
Collaborator
Collaborator

It needs to be improved indeed, based on my experience with Maya, I think this process could take 5 years.

0 Likes
Message 12 of 12

jayantbhatt07
Advocate
Advocate

haha man then I need to post it on maya idea forum LOL

0 Likes