mcjDropToTerrain - mcjDropToTerrain2 - Daz Scripts drop objects to terrain
so here you see the Bobverse island, and 64 trees which were randomly duplicated using the Send-In-The-Clones script by draagonstorm
draagonstorm posted on ShareCG ( i think ) a script that uses ( after asking me ) my old mcjCollider plugin to drop the clones to a terrain
but since that solution doesnt work for MAC users, i'll write a script.
As long as the terrain is, say, under 60000 polygons, the slowness of this script should not be too painfull
********************************************************************************
if it works or doesn't work for you, please leave a short comment below
https://sites.google.com/site/mcasualsdazscripts5/mcjdroptoterrain
and if you dont seem to be able to download the zip package from that page
then here's a direct link to the zip file
i cant be sure this link will remain valid forever tho
We Present mcjDropToTerrain2 (2022)
i worked in collaboration with TugPSX for this Upgrade
Comments
first test results
5.8 seconds to drop 10 trees on a 12000 facets terrain
( with the mcjCollider plugin it would probably be 100 times faster but hey )
second test results
50 seconds to drop 64 trees on a 12000 facets terrain
--------
i will improve the "planting" depth control and precision
here you can see there will be a "planting depth" parameter
in this case the origin of the tree is placed 40 cm below terrain level
the trunk diameter is about 40 cm
unfortunately clones of imported .obj nodes, seem to have the same node names and the same material names, which causes mcjTeleBlender to "gamma-fix" the material 64 times, making the green trees pitch-black
so i had to turn off GammaFix in mcjTeleBlender to render this
( i thought that the "rename nodes" option took care of this but apparently not always )
expected release is Saturday Jan. 17th
it will work like this:
- select all the nodes meant to be dropped-to-terrain ( the trees )
- also select the terrain node(s)
- start the script
- from the list of nodes, select the ones that are terrain nodes
- specify how deep to plant the trees
- press the doit button
Thanks again for all this work Casual. It's really appreciated. Looking forward to testing out the script on Sunday :) But no pressure...enjoy your weekend !
Thank you Casual :)
Looks wonderful!
the user interface
still on-track to post the script today
at least the DS4.5+ version
the version for DS 1, 2, 3 will follow
--
in this case you could also drop boats to the water-plane
since it's 1 of the 2 "terrain" objects
---
and i realized just now, it means i have to give options related to how thorough the ray-collision search must be
meaning, if i hit the water plane, it's not a good reason to place the tree on the water plane
i have to go through the mountain/terrain facets that may be higher
looks like the version for DS4.X is ready ! yay
( 4.5 and up )
if it works or doesn't work for you, please leave a short comment below
preferably download it from the bottom of this web page
by clicking on the blue down-arrow thumbnail/link
https://sites.google.com/site/mcasualsdazscripts5/mcjdroptoterrain
and if you dont seem to be able to download the zip package from that page
then here's a direct link to the zip file
i cant be sure this link will remain valid forever tho
https://sites.google.com/site/mcasualsdazscripts5/mcjdroptoterrain/mcjdroptoterrain.zip?attredirects=0&d=1
HI Casual,
Just to let you know, my initial tests to use the script in DS4.6 have been successful. Can't thank you enough for providing this ! Just for your information, the icon that is appearing in the menu section indicates DS1, DS2 even though the script is working fine thus far in DS4.6.
Thanks !
* ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~
* Update * Update * Update * Update * Update * Update * Update * Update * Update * Update *
the icon/thumbnail image has been corrected
it reflects the fact that this is the version for DS4.5 and up
preferred way to download the install package :bottom of this page
https://sites.google.com/site/mcasualsdazscripts5/mcjdroptoterrain
direct link to the zip file - not guaranteed to remain valid - version for DS4.5 and up only
https://sites.google.com/site/mcasualsdazscripts5/mcjdroptoterrain/mcjdroptoterrain.zip?attredirects=0&d=1
the other versions for DS1,DS2 amd DS3 may come out today
----------------
Note: this script is meant to drop down objects and figures onto 1 or more objects,
later this spring i'll probably have a more universal script closer to what mcjCollider does
presently writing/testing the Daz Studio 1, 2, 3 version of the script
also note that i will most probably post a bug-fixed version of the DS 4.7 version
( because it presently functions in a fast but imprecise mode )
Awesome, you just ticked off a major feature request for me. Thankyou!!!
I didn't have any issues running the script on my Mac running OSX10.7.2 & Daz 4.7.0.12.
The script loaded fine for the trees both above or below the selected ground terrain.
I used trees of varying sizes and locations in two lots, the tree mesh is quite high poly to.
First lot of 32 trees took 4mins 12
Second lot of 16 trees took 3 mins
Here is a quick render of the result.
* ****** * ****** * ****** * ****** * ****** * ****** * ****** * ****** *
* update * update * update * update * update * update * update * update * update *
* ****** * ****** * ****** * ****** * ****** * ****** * ****** * ****** *
January18th 2015 9:30 PM - the ds4 version was fixed to prevent the "fast" mode which was fast but prone to errors
January18th 2015 9:18 PM - now a version for DS1/DS2 and one for DS3
in case you're interested
the fast mode
which, for now, can only be enabled by manually changing the 'bFast' variable ( so this is for coders )
will stop as fast as possible to search for the surface of the terrain
so if your terrain is a water plane partly covered by a mountainous terrain
and the script "hits" the water surface, the tree will be placed there
the script wont look any further
yay!
next spring, maybe before that i will add something to the script to accelerate this greatly
(called a Bounding volume hierarchy ) http://en.wikipedia.org/wiki/Bounding_volume_hierarchy
and make this "collision detection" tool more versatile
It isn't working for me. Even though I selected 0.0 depth, it is dropping all items below the surface. I first tried with a landscape ground prop that had rolling hills. When that didn't work as I expected, (i.e. dropped below ground), I tried a flat terrain. It still dropped below ground.
I downloaded it today. The version I have is mcjDropToTerrain.dsa dated January 18, 2015. I am running DS 4.7.0.12 on Windows 7 64 bit.
the script drops the origin of tree to the ground
not the lowest point of the tree, unless they are at the same location
the origin of the object is where you see the red/green/blue arrows
there's many ways to compensate
1 - say your tree is 300 cm tall and the origin of the tree is midway, at 150 cm
then tell mcjDropToTerrain to use an offset of -150 ( minus 150 cm )
2 - create a null node, place it at the base of the tree, parent the tree to the null, drop the null-node to the terrain instead of the tree
3 - use a script that can change the location of the tree's origin, and move the origin to the base of the tree
DeltaX15's MoveOrigin script
mcjChangeOrientation
4 - move the tree to Y=0 level, export it as an obj, delete the tree, import the obj tree
5 - Go in Daz Studio / Tools / Joint Editor, move the origin to the bottom of the tree
---
Note that i will probably post very soon a revised version of the script that, as an option, does drop the bottom of selected objects to the ground
I am waiting for it then and will have to try to see how it works.
Thanks for the explanation and workarounds. The new version sounds like it will solve my problem perfectly. I'll watch for it.
Hey Long Time No See ! 2015
We Present mcjDropToTerrain2 (2022)
i worked in collaboration with TugPSX for this Upgrade
https://sites.google.com/site/mcasualsdazscripts5/mcjdroptoterrain
dropped some balls on this 'terrain' with and without the terrain being in hi-res subDivisions ( excellent song by RUSH )
This is great, never got a chance to use the original, though plan on giving it a go this time around. Now to find the other scripts I need to reinstall on a new computer lol
mCausal:
What are the differences between mcjDropToTerrain, mcjPlaceUnder, and mcjDropToTop? They seem to perform the same function.
the 2 others only see the bounding boxes of the terrain and dropping objects
mcjDropToTerrain finds the one facet among the thousands of terrain facets that lies right under the falling object and it moves the dropped object(s) onto that facet
with mcjDropToTerrain2 you can also make the dropped object sink deeper in the terrain
awesome and very usefull as usual
Thanks mCasual!! That is what I needed to know.