View Full Version : large number of objects
splash|proof 08-28-2003, 03:41 PM Hi there,
I'm trying to get a very large number of objects into a scene, but I'm wondering what would be the best way to do this.
I was wondering if it was possible to use particles for this? To specify a shape and use that shape as the particle shape or something. And I want to use this for a static image, so I don't know if particles are the way to go.
I don't want to use MEL for this, because I've never worked with this.
Or is there a way to sortof "paint" large number of objects in space.
I hope this makes sense to someone...
thanks.
|
|
DiGiman
08-28-2003, 04:18 PM
Try using paint effects.
I am not exactly sure how it works, since i've never needed to use it.
But, this is what it was made to be used for.
splash|proof
08-28-2003, 04:36 PM
ok, I've searched for tutorials on paint fx, and i found some about making flowers and hair.
But is it possible to make an object you have made yourself as the brush? And make the size and orientation variable??
DiGiman
08-28-2003, 04:40 PM
yes.
But dont ask me how.....:shrug:
splash|proof
08-28-2003, 04:44 PM
anybody who knows?
trthing
08-28-2003, 04:50 PM
I do not really know how to do it but if you are using Maya 5.0 you can customize the mesh brushes to create geometry (for instance, the teapot tool in bonus tools is a PFX converted to mesh). I don't remember instancing already modeled geometry through PFX brushes but there is a chance you can build it through mesh brushes customization...
my 2 cents
cgartists
08-29-2003, 10:27 AM
you can also use particles as you said. Particle Instancer. see Maya help. it will be handy. U can use drawing particles tool instead of emitter.
bye
lemoor
misterdi
08-29-2003, 12:41 PM
Hmmmm, you don't want to use MEL script aren't you?.
The closest than probably using particle instancer.
Problem is it will create only a single node, not that flexible for adjustment.
If you have install Bonus Tools it also has Paint Geometry Tool,
But for me, I will go with the MEL, it shouldn't be a problem creating hundreds even thousands of geometry by duplicating it, it might bogged the system down but it is possible.
Best regards,
There are several ways of doing this, which way you choose depends on what you want to achieve. Would be good if you can explain a bit of what you want to do actually in order to be able to give a more precise answer.
- duplicating (as instances!)
- geometryPaint (instances!)
- sprites and mapping images
- particles and using particle replacer
- PaintFx
In any case, if you use duplicate, make sure you use instances and not full duplicates because instanced geometry uses way less resources.
Cheers!
splash|proof
08-29-2003, 04:25 PM
I wan't to use it for images where there a for example butterflies swarming out of a tree or something.
So it would be like a cloud of particles. I was looking for a way to fill a shape up with particles, I know that's possible in 3Dmax, but not sure about maya. (probably though)
I'll look into the suggestions you gave. thanks for the replies.
Ok, I see now. There are a couple of ways to fill a shape with particles, here is 2 of them:
- make the object you want to fill a surface emitter (make sure that the normals point inwards or that you use negative speed to emit the particles inwards.). Use a copy of your geometry as a collison object to keep the particles inside the volume.
- there are a couple of scripts that fill objects with particles. One of them is called particleVolumes.mel v1.0 and can be found on www.highend3d.com
I would go for the script solution!
splash|proof
08-29-2003, 10:36 PM
yeah thanks, I accidentally ran into that script before, but like I said, I have no experience using scripts at all.
I haven't tried it yet, but could you give some pointers on how to use MEL scripts. Or this script anyway.
On the downloadsite it also says the script has notes on how to use the script, but how to access these notes???
fiercekitten
08-30-2003, 03:00 AM
You said you wanted to be able to paint objects in space. There's a tool in maya that's called Geometry Paint Script Paint Tool. I've never used it, but I read about it in a book and this is how the book says you use it.
In order to paint your model, this is what you do.
Make a shape on which you will be painting. You can turn off it's visibilty during render time.
While that shape is selected, go to Modify->Script Paint tool ->Options
In the setup tab, erase anything that's in any of the fields. And under Tool Setup Cmd type "geometryPaint" and press enter.
A window should pop up, and in the Geometry Field, type the name of the model you want to paint.
Now just paint.
No MEL?
Sounds like an ideal situation for MEL actually.
If you are not comfortable with MEL try this: Open the Script editor and type or copy/paste this piece of code:
global proc scatter(int $nObj, float $bBox)
{
// Get selected object
string $cObj[] = `ls -selection`;
// Create a group for all the duplicates
string $cGroup = `group -empty`;
// loop through this routine $nObj times
int $i;
for ($i = 0; $i < $nObj ;$i++)
{
// Duplicate object
string $cloneObj[] = `duplicate $cObj[0]`;
// Parent it to the grop
parent $cloneObj[0] $cGroup;
// Create random rotation & translation
float $rotX = `rand 0 360`;
float $rotY = `rand 0 360`;
float $rotZ = `rand 0 360`;
float $trnX = `rand (-$bBox) $bBox`;
float $trnY = `rand (-$bBox) $bBox`;
float $trnZ = `rand (-$bBox) $bBox`;
// Move clone relative to the base object
xform -relative -rotation $rotX $rotY $rotZ -translation $trnX $trnY $trnZ $cloneObj[0];
} // End the loop
}
(too bad that this forum removes the indention... makes the code a little harder to read... ah well)
Press ENTER on the numeric keypad after you have entered the code. This will prompt Maya to digest the code. Maya will (hopefully) gracefully accept the code (it works here :) )
Then select your object and write in the script editor or the command line (recommended - press up arrow and you will get your last command if you need to redo it).
scatter(100, 10)
-> this will create 100 copies of the selected object and distribute them randomly in the range -10 units to +10 units around the original and rotate randomly each around all axxes.
If you study the code I think you can modify it to suit your needs. I made it simple in order to illustrate the technique.
If you find it useful, save it in a file called scatter.mel in your maya/scripts/ directory and you will always have access to it.
Cheers!
/ Daniel
:beer:
P.S. Use at own risk - no warranties given etc. etc. D.S.
I general you use a MEL script by sourcing it:
- open the script editor
- >File > source script
- select the script that you want to use and press 'open'-button.
Now the script is loaded in the memory (only last for you current Maya session) and is ready to use.
In case of the particleVolumes.mel you just type: 'particleVolumes' in the commandline or scripteditor, an optionwindow will popup and you are ready to go.
Most MELscripts contain some information on how to use them. To see that info just open the script in a texteditor (UltraEdit, Wordpad, NotePad, SimpleText, the list is endless....)
wgreenlee1
08-30-2003, 08:50 PM
Thanks jdj!
mark_wilkins
08-30-2003, 09:18 PM
I haven't tried it yet, but could you give some pointers on how to use MEL scripts.
You might find the book in my signature interesting, particularly if you're doing scripted particle effects. One of our examples covers filling an object up with particles, among other things.
I'd definitely use particle instancing for what you describe, although a common technique is to hand animate any butterflies that become individual focuses of attention so that you can have greater control.
-- Mark
splash|proof
08-31-2003, 07:44 PM
hmm, okay. I'm getting a bit confused here. What is particle instancing?? Is it replacing the shape of the particles with another shape/ model?
And why would you recommend that? I'm don't want anything animated, just a still.
care to elaborate??
Particle instancing is using the every particle's position (and even other attributes) to position another obeject (a sphere, a cube, a curve, paintFx stroke, locator, ...)
Even if you don't want to animate it is usefull since it allows you to postion a bunch of objects in no time.
Hi again,
I got snowed in on the MEL track here, but I think I agree that particle instancing would be better in this case. I missed your post about a swarm and thought you only wanted some background pebbles or something.
The drawback with the MEL approach is that the result is *very* static. With particles you can at least play around with the settings etc. to tweak the look - even if you're just going to make one frame.
To get that swarmy look, I would probably go for an particle system + emitter & perhaps some force fields to break up the regularness of it all and then grab the frame somewhere down the timeline.
Particle instancing also have the advantage that you can get several different types of copies displayed: bees with wings high, low and in the middle etc etc.
Check the online help, in Maya 4 you can find it under "Dynamics" / "Particles" / "Instancing animated geometry".
Just as a coincidence the example talked about is... a swarm of insects! :)
Cheers!
/ Daniel
:beer:
mark_wilkins
09-01-2003, 01:01 AM
The drawback with the MEL approach is that the result is *very* static.
Not if you're using the MEL script to set up particle instancing the way you want it, or using particle expressions to control instancing in a way that gets you an interesting, dynamic result!
However, the original poster did come back and say that he's not trying to create an animated scene, just a still...
BTW, creating a ton of geometry with MEL is guaranteed to be SLOOOOOOOOOOW, as will be scene evaluation once you've done so, so even if you're not animating, particle instancing is the way to go.
-- Mark
Nicool
05-02-2004, 09:52 AM
Hye CGtalkers,
I've writen an artcile about objects spreading you can find here : http://ndhaussy.free.fr/temp/spreadArticle/
CGTalk Moderation
01-15-2006, 11:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.