Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 07-12-2005, 04: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
 
Steve555 is offline   Reply With Quote
Old 08-12-2005, 01: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 01:53 AM.
Phopojijo is offline   Reply With Quote
Old 08-12-2005, 11: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, 12:14 PM   #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, 12:22 PM   #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, 01: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, 01: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, 02: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, 02: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

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.