User avatar
By deadalvs
#203037
morning.

has anyone a usable MEL script that can set props to the next polygon right underneath it's pivot point, like «place on floor» in bryce or vue d' esprit ?

it should be stack-friendly, so if i place boxes on a plane and there's boxes everywhere that the new boxes will be placed on top of each other.

or how would i script this efficiently?

* * *

deadalvs
User avatar
By 3dtrialpractice
#203056
the only thing I use is the base pivot script from highend.. not exactly what your looking for .. but comes in super handy for placing things on the "floor... if the floor is the 0 y axis(or any snappable/grid point)

http://www.highend3d.com/maya/downloads ... -2679.html

BUT this will not do what u want.. just handy for moving the pivot to the bas of the box. .then you have to mannually move the object ( i snap it to 0,0,0)

Motion Builder has a Define floor and a floor system like you seek.. and since motion builder has it I'm sure that maya can do it. .or at least there can be a script for it..

the only way of the top of my head that I can think of right now (early in the moringin) is to use dynamics.. Buit this would be a round about solution.. needs to be an easy way...
User avatar
By deadalvs
#203090
hmm... this might be very complicated.

i have looked for algorithms that do this but they all solve just parts of the problem and are written in C or C++ or whatever. they all are based on some kind of tree search which try to find the correct face/polygon in fastest time without having to search thru all faces in the whole scene. with only a few polys this is easy to script, but will get very slow with multiple 1000 polys or even objects.

i have seen some time ago a MEL scripted kit for game level editing and filling in content and props with this drop command - i just don't know anymore which kit this was.

there's this maya command called «align». but it doesn't help since it uses the bounding box of the selected objects. cool for boxes, but not for other geometries...

* * *

of course i have in mind of making a «populate script» that lets randomize all kinda crap round the scene. like stones, bricks, metallic trash, dirt, garbled oil barrels or whatever.

i'd like to produce some procedural props that can be randomized, as mentioned oil barrels or pipes that always look different but have the same root. i also would like to hack in some randomized scratches and holes to make it look dirtier...

who's in ?

* * *

deadalvs
User avatar
By deadalvs
#203091
references:

city scenes of «final fantasy - the spirits within»

* * *

deadalvs
User avatar
By deadalvs
#203096
problem with mayas built-in dynamics:

1) complex geometries might crash maya (tree against terrain)
2) the orientation of props should not change and needs constraints. for example a tree should stay upwards when dropped to the terrain and not drift down the slope.
3) simulation times change from object to object. a box on a roof might fall less long than a second box that hits the street. the faster objects fall the less precise is collision detection and again crashs can occur. or poly intersections between object and «receiver»
4) attaching rigid bodies to objects and run them individually might take forever with several 100 objects and the maya rigid solver
5) some topologies might not work properly with a rigid solver like barbed wire, plants, ...

it's like shooting sparrows with cannons.

* * *

deadalvs
User avatar
By deadalvs
#203099
an idea could be to define areas that can receive objects, meaning always the top surface of an object, with a special material or poly selection that can be accessed and used to scatter objects onto.

of course, the sum of these material's areas would equal to the y-projected surface of the whole terrain.

* * *

deadalvs
By Boris Ulzibat
#203100
How about combining the script mentioned above (moving the pivot to the downmost part of the object on y-axis only) with the script looking for closest face in y-axis, then moving the object to this face's coordinates?
User avatar
By lebbeus
#203101
Doesn't version 8.0 deal with this type of thing better? I know it now has drag and create like MAX…
By cali3d
#203286
drag and create like max = disabled !! its so annoying ! (this is ofcause a matter of preference)

but what you do is you move the pivot by snapping it to an edge or a vertex and then snap the object to its position, or if its 0,0,0 then write it in its transforms, or hold down X while snapping it to the grid
User avatar
By 3dtrialpractice
#203313
maybe this will do what you need it too.. posted on highend lately...

basically look at the bottom right example in the picture with the boxes on the curved nurbs plan.. you would just have to move the pivot of the original box to the bottom of the box(quickly w/basepivot.mel) BEFORE running this script and it should place your objects onthe object you designat (curved nurbs plane would be your floor)

http://www.highend3d.com/maya/downloads ... -3169.html
Last edited by 3dtrialpractice on Wed Jan 03, 2007 12:59 am, edited 1 time in total.
User avatar
By deadalvs
#203316
thanks for the tip, 3dtrial.

i glimpsed at it and tried the script. a lot of code and nicely written, especially the layout is cool.

but the effect with the bottom right example is mainly that an object is copied and moved to a cv or specific point of the desired surface and then rotated along the surface normal.

i scripted the same thing already some time and it won't help me with this... :(

well, i have no time at the moment, i SHOULD learn for my final exams... damned... :cry:

but i'll find a way sooner or later... HA ! (i think i'll have to do some programming with a ray that gives back the result of the first meeting with a polygon or infinity, but intersecting for example a nurbs curve with polygons is not working. else i'd have to model and script all with nurbs... well.)

thanks, guys !

* * *

deadalvs
User avatar
By 3dtrialpractice
#203351
ya.. I don't know why maya cant do this relevtivley easy.. just because Motion Builder has a "floor" contact tpoint for all the hands/feet and props inside of that app.. I mean Even POSER has a "drop to floor" command...so there definatly should be a way maya can do it..

Do you have maya platinum membership? If you do you can go to the "ask alias" errhh now ask autodesk section of the support page and ask the maya mel programers directly with assistance..

My problem is that I have 1% of knowledge of mel.. basically I understand what it does. .I had an Introduction to MEl class in school.. were I wrote very simple scripts.. but since graduating 4 years ago I have not followed through with mel training.. so there is alot of stuff that just goes way over my head..

maybe also post this on cgtalk and on the highend forums..

wish I could help mo.
-Luke
Last edited by 3dtrialpractice on Wed Jan 03, 2007 12:59 am, edited 2 times in total.
By Boris Ulzibat
#203375
3dtrialpractice wrote:I had an Introduction to MEl class in school..
I am sorry for offtopic, but i just envy you so much!!!
You have a chance to be taught something...
T_____T
If only Russia had some CG education (something better then "Learn MAYA in a week" course)... I wouldn't spend 8 years in medical university...

Sorry for offtopic again!
User avatar
By 3dtrialpractice
#203378
hey Boris.. well that mel class was nothing crazy.. It was the FIRST year the professor was doing it so it was pretty much doing tutorials and he was learning mel as we were too.. he was a great guy.. he was teaching Unix scripting originally when the school told him to convert his unix classs to mel.. so as you can imagine not too much that was related to mel.. ½ of the class was still unix comands(the school was using O2's at the time)

BUT if you want a good resource for mel scripting. (I bought the book but have yet to have time to read it) REad "MEl scripting for Animators" you can find it on amazon..http://www.amazon.com/Scripting-Animato ... F8&s=books


My old roomate from school has been working for PDI-Dreamworks and he says he worked with the one of the guys that wrote the book and recommended it to me.. so I am passing along the recomendation
Last edited by 3dtrialpractice on Wed Jan 03, 2007 12:59 am, edited 1 time in total.

after a lot of years doing arch-viz... almost 20 a[…]

render engines and Maxwell

Funny, I think, that when I check CG sites they ar[…]

Hey, I guess maxwell is not going to be updates a[…]

Help with swimming pool water

Hi Choo Chee. Thanks for posting. I have used re[…]