scatter script ? (just an idea)

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
DominiqueBray
Posts: 100
Joined: Sun Sep 17, 2006 2:32 pm
Location: France

scatter script ? (just an idea)

Post by DominiqueBray »

Hello

I just had this idea, a scatter script for AS like Vue has.

Here is how it works in Vue. You put two objects
Image

so they are the corners of a virtual square that will be the area where your objects will be scattered.
Image

then you click "Scatter/Replicate" to tell this window how many copies of your objects you want, and if you want them to get resized or rotated.
Image

and the program scatters objects for you
Image

This way you can quickly get a cool field of flowers or else. 8)


Here is a little test scene I am making with Anime Studio. My idea is to make the camera fly over a field of these flowers, because my character got onto a flying insect. :wink:
Image
Image
Image

Quite nice isn't it ?

I just did draw a few flowers and weed, then import them into AS. But I scattered myself and it was borring just to get this small field of flowers... :x So imagine how borring would be to scatter for a field of flowers. :shock:

So, could any scripter here make a scatter script please ? I am sure it would be useful for many over people in many over cases.
________
Dating advice dicussion
Last edited by DominiqueBray on Fri Feb 25, 2011 12:33 am, edited 1 time in total.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Hmm...

It would actually be harder to create the pop-up window interface for this than to actually write the code to do it.

It is absolutely possible to do. Plus... it might be interesting if the mesh was already animated BEFORE duplication... you could throw in some kind of offset on the frames and have waving fields of flowers... or a crowd of people (simple people with point motion)... etc etc.

If I get bored I might give it a go. No promises. I don't have as much experience creating scripts with vector layers... I'm more of a bone guy. ;) Also menu scripts are twice as hard to create. There is a lot more code to deal with especially with really complex pop-up windows.... yikes! Just looking at that sample makes me dizzy imagining it in code. ;)

-vern
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Why don't use particles?
If you set a the proper settings you can achieve a filed of whatever you want inside.

http://www.darthfurby.com/genete/Other/flowerfield.avi
http://www.darthfurby.com/genete/Other/flowerfield.anme

Image


Also you can make your field quite different if you want some variation just pressing the Randomize button when select the Particle button tool.

My two cents. :wink:
-G
User avatar
DominiqueBray
Posts: 100
Joined: Sun Sep 17, 2006 2:32 pm
Location: France

Post by DominiqueBray »

I never understood how to make particles that do not move. Thanks you very much for the example, maybe I will understand thanks to it. I will try it right now. 8)

Thanks anyway heyvern.
________
Free Gift Card
Last edited by DominiqueBray on Fri Feb 25, 2011 12:33 am, edited 1 time in total.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

DominiqueBray wrote:I never understood how to make particles that do not move. Thanks you very much for the example, maybe I will understand thanks to it. I will try it right now. 8)

Thanks anyway heyvern.
Phew!

;)

-vern
User avatar
DominiqueBray
Posts: 100
Joined: Sun Sep 17, 2006 2:32 pm
Location: France

Post by DominiqueBray »

It works well ! :)

I just have a problem with the depth sorting, some far flowers are in front of closer flowers. :roll: Can you help me ?
I tried putting them in a group and checking "sort layers by depth" and "sort by true distance" but the problem stills.
________
Roor Bongs
Last edited by DominiqueBray on Fri Feb 25, 2011 12:34 am, edited 1 time in total.
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

DominiqueBray wrote:It works well ! :)

I just have a problem with the depth sorting, some far flowers are in front of closer flowers. :roll: Can you help me ?
I tried putting them in a group and checking "sort layers by depth" and "sort by true distance" but the problem stills.
I think the particles should be placed properly at its spatial position depending on particle layer properties. As well as the flowers in the particle layer are a bunch of copies of the few under it, they cannot be sorted by depth because the layers copy are not real existing layers (I think), but they are copies of the existing layers placed at the random 3D position given by the particle parameters. So You don't have a depth sort check box in the particle layer. I remember a post from Ramón López that claims for this "bug".

I know you have had a battle about depth sort and that you're so sensible with that issue but in this case I don't have the solution.

Is really so important for you that perfect 3D look? I didn't notice it in my animation sample and only looking for some weird flowers I have seen the problem.

-G
User avatar
DominiqueBray
Posts: 100
Joined: Sun Sep 17, 2006 2:32 pm
Location: France

Post by DominiqueBray »

My particles are not 3d objects, they are just three .png files with a drawing like this one :
Image

I did put them in the particle layer, one by one :
Image


I did set my particle layer exactly like yours.

With yours, it works :
Image

With mine, there is a problem :
Image

I really do not understand... I checked all the settings though. :?
I know you have had a battle about depth sort
Yes, I even created a topic. But this time I did not use 3d object, and did not made any rotation, so everything should go well.
Is really so important for you that perfect 3D look?
I need to put these flowers in a 3d field because, as I said, my idea is to make the camera fly over a field of flowers because my character got onto a flying insect.

If I do not find, I will just keep on working with your file. :wink:
________
MERCEDES-BENZ 500E
Last edited by DominiqueBray on Fri Feb 25, 2011 12:34 am, edited 1 time in total.
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Maybe if you post the file you've created I could find why your is not working and mine yes. (?)
Did you uncheck the sort layers by depth?. Maybe that confuse the program...

-G
User avatar
DominiqueBray
Posts: 100
Joined: Sun Sep 17, 2006 2:32 pm
Location: France

Post by DominiqueBray »

Last edited by DominiqueBray on Fri Feb 25, 2011 12:34 am, edited 1 time in total.
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

The only difference I can see is the position of the particle layer, the ground layer and the values of zoom and position of the camera.

I have set those values for your file and I see it quite good (without artefacts):

Particle layer: (0,0,0) (z changed)
Ground layer: (0, -0.08, 0) (z changed)
Camera position: (-0.0979, y = 0.1223, z= 4.75) (z changed)
Camera zoom: z = 33.28 (small change to fit background)

Please try it and let me know.
Best
-G
User avatar
DominiqueBray
Posts: 100
Joined: Sun Sep 17, 2006 2:32 pm
Location: France

Post by DominiqueBray »

Are you sure of these values ? Here is my sceen, the flowers are far away
Image

When I zoom I see there still the problem...
Image
Image
________
MY WEBCAMS HOOKUP
Last edited by DominiqueBray on Fri Feb 25, 2011 12:34 am, edited 1 time in total.
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Don't zoom. Just move the camera.
User avatar
DominiqueBray
Posts: 100
Joined: Sun Sep 17, 2006 2:32 pm
Location: France

Post by DominiqueBray »

Ok, I just set the camera 's z to 2 to get closer to the flowers instead of zooming. Same thing.
Image
________
MARIJUANA VAPORIZERS
Last edited by DominiqueBray on Fri Feb 25, 2011 12:34 am, edited 1 time in total.
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

So the bug is confirmed. I have not a solution for that. :(
Post Reply