Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Maya Basics & Newbie Lounge (https://simplymaya.com/forum/forumdisplay.php?f=31)
-   -   Quick way to duplicate/scale concentric walls? (https://simplymaya.com/forum/showthread.php?t=19386)

Steve555 07-12-2005 04:04 PM

Quick way to duplicate/scale concentric walls?
 
1 Attachment(s)
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.)

Phopojijo 08-12-2005 01:50 AM

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)

Alan 08-12-2005 11:25 AM

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

:ninja:
A

Steve555 08-12-2005 12:14 PM

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.

Alan 08-12-2005 12:22 PM

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

:ninja:
A

Steve555 08-12-2005 01:06 PM

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 //

Alan 08-12-2005 01:45 PM

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

Steve555 08-12-2005 02:34 PM

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

Alan 08-12-2005 02:42 PM

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


All times are GMT. The time now is 06:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018