SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Lounges / Maya Basics & Newbie Lounge / Quick way to duplicate/scale concentric walls?
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 07-12-2005, 03:04 PM   #1
Steve555
Subscriber
 
Join Date: Oct 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default Quick way to duplicate/scale concentric walls?

In order to make the concentric inner wall iin the picture, I had to duplicate the outer wall and then manually butcher the polygons it until it was what I wanted. I wanted to make a large structure with around 50 such concentric walls and so it's going to take forever.
Unforunately just scaling the duplicate obviously scales the size of the 'bricks' as well.
Can anyone suggest a shortcut to do this?

Thanks

Steve

(FWIW, the original wall was made with a subdivided poly cube with the the inner sections deleted. Then a duplicate was made and edited to provide the inner walls to give the appearance of it being solid.)
Attached Thumbnails
Click image for larger version

Name:	walls.jpg
Views:	66
Size:	65.8 KB
ID:	25546  
Steve555 is offline   Reply With Quote
Old 08-12-2005, 12:50 AM   #2
Phopojijo
Registered User
 
Join Date: Aug 2004
Posts: 408
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I assume they're all cubes?

Why not just extract the faces you wish to copy and simply drag them with either snap-commands or manual number-crunching translations (so as to get each brick exactly lined up)

You don't need to copy just 1 object at a time... you can copy whole groups of objects.

May I ask why its necessary to have the walls made like that? (all I see are wasted polygons)

Last edited by Phopojijo : 08-12-2005 at 12:53 AM.
Phopojijo is offline   Reply With Quote
Old 08-12-2005, 10:25 AM   #3
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

ok I've got something, I'm still working on the 2d part of the answer.

Make a whole bunch of cubes that are concentrict like you need then select them all and run this:

global proc buildBricks(float $brickWidth)
{
string $sel[] = `ls -sl`;
for($s in $sel)
{
float $scalex = `getAttr ($s + ".scaleX")`;
float $scalez = `getAttr ($s + ".scaleZ")`;

select -r $s;
string $dupe[] = `duplicate $s`;

setAttr ($dupe[0] + ".scaleX") ($scalex - $brickWidth);
setAttr ($dupe[0] + ".scaleZ") ($scalez - $brickWidth);

string $t[] = `polyBoolOp -op 2 -ch 1 $s $dupe[0]`;
$s = $t[0];
}

}

buildBricks(0.2);

that will build the walls at the right thickness.

I'm working on the brick making. I have it working but it's being very frsutrating and crashing maya all the time. I'll keep working on it


A
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 08-12-2005, 11:14 AM   #4
Steve555
Subscriber
 
Join Date: Oct 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks... I think I can glean from the code what should happen, but I'm getting a stack of syntax errors. Could you walk me through the steps to running the code? Other than writing some simple MEL scripts, I'm new to this kind of stuff and think that's where I'm going wrong. How do I call the function with the desired value for the variable brickWidth?

(Phopojijo... "why its necessary to have the walls made like that? (all I see are wasted polygons)"
I'm experimenting with adding different textures per face, and randomizing the vertices slightly to get something bumpier. It may be a dead end, but it's good learning experience, if only to find out what ideas don't work and why.
Steve555 is offline   Reply With Quote
Old 08-12-2005, 11:22 AM   #5
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

I dont get any syntax errors when I run it. What are you getting?


A
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 08-12-2005, 12:06 PM   #6
Steve555
Subscriber
 
Join Date: Oct 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

As I say, it's probably down to me not knowing how to execute it. I just pasted it in and hit Enter.

// Error: global proc buildBricks(float $brickWidth)({(string $sel[] = `ls -sl`;(for($s in $sel)({(float $scalex = `getAttr ($s + ".scaleX //
// Error: Syntax error //
// Error: global proc buildBricks(float $brickWidth)({(string $sel[] = `ls -sl`;(for($s in $sel)({(float $scalex = `getAttr ($s + ".scaleX //
// Error: Syntax error //
// Error: ...global proc buildBricks(float $brickWidth)({(string $sel[] = `ls -sl`;(for($s in $sel)({(float $scalex = `getAttr ($s + ".scaleX //
// Error: Syntax error //
// Error: ...global proc buildBricks(float $brickWidth)({(string $sel[] = `ls -sl`;(for($s in $sel)({(float $scalex = `getAttr ($s + ".scaleX //
// Error: Syntax error //
// Error: ...global proc buildBricks(float $brickWidth)({(string $sel[] = `ls -sl`;(for($s in $sel)({(float $scalex = `getAttr ($s + ".scaleX //
// Error: Syntax error //
// Error: ...global proc buildBricks(float $brickWidth)({(string $sel[] = `ls -sl`;(for($s in $sel)({(float $scalex = `getAttr ($s + ".scaleX //
// Error: Syntax error //
// Error: ...global proc buildBricks(float $brickWidth)({(string $sel[] = `ls -sl`;(for($s in $sel)({(float $scalex = `getAttr ($s + ".scaleX //
// Error: Syntax error //
// Error: ...global proc buildBricks(float $brickWidth)({(string $sel[] = `ls -sl`;(for($s in $sel)({(float $scalex = `getAttr ($s + ".scaleX //
// Error: Syntax error //
// Error: ...global proc buildBricks(float $brickWidth)({(string $sel[] = `ls -sl`;(for($s in $sel)({(float $scalex = `getAttr ($s + ".scaleX //
// Error: Syntax error //
// Error: ...global proc buildBricks(float $brickWidth)({(string $sel[] = `ls -sl`;(for($s in $sel)({(float $scalex = `getAttr ($s + ".scaleX //
// Error: Syntax error //
// Error: //
// Error: Syntax error //
Steve555 is offline   Reply With Quote
Old 08-12-2005, 12:45 PM   #7
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

looks like the lines are truncated. Make sure that the script lines are being finished off properly and not cutting off half way through

A
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 08-12-2005, 01:34 PM   #8
Steve555
Subscriber
 
Join Date: Oct 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It looked fine in the editor. I typed it in manually rather than pasted it and then it ran OK. Some invisible formatting stuff must've been there.

I can only assume you're creating your source brick walls in a completely different way to me, because all I get is a few random faces duplicated. I tried building it brick by brick, or by subdividing a cube but it's not producing anything but a few odd cubes and faces.
Any chance you could post a scene that you got it to work with?

If not, no sweat, I may be able to get some clues from your code, but I'm intigued as to what your results are.


foursheds@btinternet.com
Steve555 is offline   Reply With Quote
Old 08-12-2005, 01:42 PM   #9
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

all I did was create a cube and then select it and run that script... it will remove the middle based on how thick you want your walls. It will mean you can have different scales of boxes but the wall width stays the same.

A
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.