meshinstance mod

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

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

meshinstance mod

Postby synthsin75 » Mon Sep 29, 2008 2:48 am

I can't believe I haven't posted this. (Thanks for reminding me, Madrobot!)

This is an improved meshinstance layer script. It functions just as Fazek's with the exception of the naming convention. With Fazek's all of your duplicate instances had to have the same name ("original layer name.dup"). If you use several instances, like I do, this makes it hard to find a specific layer for layer sorting.


1) Embed this script in a vector layer you wish to instance.
2) Duplicate that vector layer as many time as you like, renaming it to follow the conventions below. (The duplicate will already be embedded as well)
3) Point motion animation on the original vector layer will now be duplicated on its instances.

Make sure to keep the original below its instances in the layers window.

------------------------------Naming conventions-----------------------------------------------------

For original layer "Name", its instances can be named "Name.<any name or no name>.dup".

Example: Original layer named "character" can have instances named "character.dup", "character.rt_forearm.dup", "character.torso.dup", etc.

-------------------------------You can download it here.----------------------------------------------------

Some tips on use:

----Meshinstance only instances the point motion. Fills, outlines, line width, point curvature, and layer manipulations (Basically everything but point motion) can still be done to each instance.

Warning, deleting any vector points from an instance will 'break' the instance. It may still work partially, but I don't recommend it.

If you are careful not to delete any of the instanced vector points, you can even change how the splines connect them.

What this means is that you can make many instances of a whole character on one original layer and, by filling each body part separately in different instances, use these for layer sorting.

----When I create a character, I go ahead and setup all of its instance layers. But too many layer scripts seriously slows down playback in AS, making it very difficult to judge timing while animating.

So after I have made all of the instances, I create a duplicate of the file where I delete them and animate with the single original layer for better playback speed. After animating, these can be imported back in ready to go.

Warning, I have found a very small glitch. If your instances are not in the same bone layer that is controlling your original, it looks as if random frames while rendering are not updating the bone offset. Keeping the instances in the same bone layer as the original remedies this.

Edit: I haven't run into this glitch again, so it may be something that cropped up in the file I was working with.

Please let me know if you find this useful. It helps modivate my scripting endeavors. :wink:[/b]
Last edited by synthsin75 on Mon Oct 13, 2008 9:50 pm, edited 1 time in total.
User avatar
Posts: 6753
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma

Postby madrobot » Mon Sep 29, 2008 5:52 am

That's great Synthsin
I'm a big meshinstance fan
this will make it easier to follow what I'm doing.
I like the naming function
(and imagine it would only take a few complex files without it to lose track of what you're doing without it)
So thanks.

Scripts have quickly become indispensible
I got AS running on the mac at work today (finally)
and found getting the scripts on there was as important as upgrading
(meshinstance and Fazek's tools for now)

As a script user but not writer
"THANKS!" to all the scripters :D
User avatar
Posts: 632
Joined: Mon Apr 07, 2008 3:07 pm

Postby synthsin75 » Mon Sep 29, 2008 11:58 pm

Yeah, I always feel meshinstance is a grossly under used script.

I'm glad to contribute what little I can. I can appreciate what the real scripters go through. I agree, AS now feels very clumsy if I try to use it without Fazek's tools.

User avatar
Posts: 6753
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma

Postby slice11217 » Tue Sep 30, 2008 3:19 am

This is a great idea. Now the number of layers in a project can be reduced.

I'm thinking: I wonder if in a future update some of these 'indispensable' scripts will be incorporated into AS. Then scripting can solve other problems.

Posts: 278
Joined: Thu Mar 30, 2006 6:12 pm
Location: Verona, New Jersey

Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests