Merge script

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
Sevenmile
Posts: 51
Joined: Sun Nov 14, 2004 12:42 am
Location: Uddevalla, Sweden
Contact:

Merge script

Post by Sevenmile »

Hi!
I wonder if anyone could make a script for me. I want a script that takes the layers in a group layer out of the group layer and adds the the translation and rotation values of the group layer to these layers.
/Jacob

Bye the way - Moho ROCKS!
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Do you mean merge them all into a single layer? or move them out of the group while applying the parent group layers translation and rotation settings to them? Just the "on the flat", or do you need full 3d transformations? You gotta be a little more specific. What's the purpose? I've made up a few scripts that people have asked for, but generally 'cause I'd like to have them, too. If there's something specific that whatever it is you want would be really handy for, I'll put it on my list.

--Brian
Sevenmile
Posts: 51
Joined: Sun Nov 14, 2004 12:42 am
Location: Uddevalla, Sweden
Contact:

I mean...

Post by Sevenmile »

Hi 7feet! I mean a script that moves them out of the group while applying the parent group layers translation and rotation settings to them. I'm building symmetric 3d-buildings and I think it would be of great use.
/Jacob
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Okay, now I see where you're coming from. And I have to ask, why on earth would you want to take them out of the group? I mean, it's entirely possible, but you end up with a a ton of disconnected layers, and no effective way to move the "building" as a piece after you've pulled out the layerss. Let me decribe a different scenario.

I did the same thing. In fact, if you want to look, here is one on the buildings that I put together. I made 6 or 7 differnet ones, each with a front and back that could be used for the street side so that they would be reversible for variety. I also made various types of street sections, also in 3D (needed those curbs). Saved them all as group layers (1 per building type) in a file, and then import them as Moho objects as needed. Leaving them in groups makes all the pieces easy to shuffle around. If you pull the layers out of the group, you're locked in, and also make a more cluttered layout.

If you still really want it, and I don't quite understand the why, I may do it anyway, as I haven't played with that kind of thing in the scripting yet, and I have some other things I want to do that involve some pretty intense layer creation and shuffling. Might be good practice

--Brian
Last edited by 7feet on Fri Dec 03, 2004 1:21 pm, edited 1 time in total.
Sevenmile
Posts: 51
Joined: Sun Nov 14, 2004 12:42 am
Location: Uddevalla, Sweden
Contact:

Hm...

Post by Sevenmile »

Hmm... Thanks to your building I've realized that I might have misunderstood the way Moho handles 3D layer depth sorting :oops:
Thanks for opening my eyes, Brian :shock:
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

The trickiest thing to figure out when I was doing these was realizing how absolutely important the layers origin is in determining depth sorting for 3d layers. I did a lot of shuffling to get everything to work from almost any view. The sort is determined by the relative distances of each layers origin from the camera at any particular time, and has absolutely nothing to do with whats in the layer.

--Brian
Sevenmile
Posts: 51
Joined: Sun Nov 14, 2004 12:42 am
Location: Uddevalla, Sweden
Contact:

Post by Sevenmile »

Yeah, I've finally realized that thanks to your building, and though it feels kinda weird, I think that I will be able to build my castle now :D
/Jacob
User avatar
sherlock
Posts: 48
Joined: Fri Nov 05, 2004 1:31 am
Contact:

Post by sherlock »

Brian

Any chance we could see a tutorial of how your building was created? The outcome was fantastic.

If not.........can I buy your buildings from you? :wink:

HL
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

I'll see what I can work up as far as a tutorial goes. The basics of the shape are just rectangles with detail translated in 3D space. The only really tricky part was the front steps, and messing with the layer origins until everything stayed visible from different angles.

I had tried them originally with a brick image texture applied to the building surface, but it was godawful slow. One thing I was going to try was to draw up the buldings faces in another app, and then build it from image layers. That would probably look good and render reasonably quickly. As it is, I made a "city" of about 12 square blocks, probably 40 buildings, and even in wireframe mode it only previews at maybe 4 or 5 frames a second. I figured for animation I'd have to do a background pass, and then lose the buildings and render out the characters separately and composite them later.

--Brian
Post Reply