mcjDropToTerrain - mcjDropToTerrain2 - Daz Scripts drop objects to terrain

mCasualmCasual Posts: 4,607
edited March 2022 in Freebies

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

https://sites.google.com/site/mcasualsdazscripts5/mcjdroptoterrain/mcjdroptoterrain.zip?attredirects=0&d=1

We Present mcjDropToTerrain2 (2022)

i worked in collaboration with TugPSX for this Upgrade

droptoterrain1.jpg
1920 x 1080 - 906K
ddt2Promo.jpg
932 x 760 - 128K
Post edited by mCasual on

Comments

  • mCasualmCasual Posts: 4,607
    edited January 2015

    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

    droptoterrain2.jpg
    1920 x 1080 - 743K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited December 1969

    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

    droptoterrain3.jpg
    1920 x 1080 - 777K
  • mCasualmCasual Posts: 4,607
    edited December 1969

    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 )

    droptoterrain4.jpg
    1920 x 1080 - 327K
  • mCasualmCasual Posts: 4,607
    edited January 2015

    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

    Post edited by mCasual on
  • rksrks100rksrks100 Posts: 49
    edited December 1969

    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 !

  • DraagonStormDraagonStorm Posts: 748
    edited December 1969

    Thank you Casual :)

  • KeryaKerya Posts: 10,943
    edited December 1969

    Looks wonderful!

  • mCasualmCasual Posts: 4,607
    edited January 2015

    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

    bigLogo.jpg
    554 x 554 - 151K
    dropppp.jpg
    1280 x 540 - 164K
    HELPER.jpg
    448 x 590 - 151K
    guifallen.jpg
    1128 x 644 - 400K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited January 2015

    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

    promosmdroptoterrain4.jpg
    1920 x 648 - 322K
    Post edited by mCasual on
  • rksrks100rksrks100 Posts: 49
    edited December 1969

    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.

  • mCasualmCasual Posts: 4,607
    edited January 2015

    rksrks100 said:
    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

    mcjDropToTerrain.dsa_.png
    91 x 91 - 13K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited January 2015

    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 )

    dsa1dsa2.jpg
    1920 x 800 - 694K
    lahdeedah.jpg
    1920 x 1080 - 749K
    rororo.jpg
    1920 x 1080 - 591K
    Post edited by mCasual on
  • Design Anvil - Razor42Design Anvil - Razor42 Posts: 1,237
    edited December 1969

    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.

    DroptestMCJ.jpg
    700 x 769 - 182K
  • mCasualmCasual Posts: 4,607
    edited January 2015

    * ****** * ****** * ****** * ****** * ****** * ****** * ****** * ****** *
    * 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

    promoz.jpg
    594 x 226 - 86K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited December 1969

    Razor 42 said:
    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.

    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

  • barbultbarbult Posts: 24,243
    edited December 1969

    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.

    Droptoterrain.PNG
    2000 x 1244 - 2M
    Screenshot_2015-02-02_14.59_.38_.png
    820 x 433 - 24K
  • mCasualmCasual Posts: 4,607
    edited February 2015

    barbult said:
    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

    je.jpg
    850 x 720 - 113K
    Post edited by mCasual on
  • MilosGulanMilosGulan Posts: 1,958
    edited December 1969

    I am waiting for it then and will have to try to see how it works.

  • barbultbarbult Posts: 24,243
    edited December 1969

    Thanks for the explanation and workarounds. The new version sounds like it will solve my problem perfectly. I'll watch for it.

  • mCasualmCasual Posts: 4,607
    edited March 2022

    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

     

    ddt2.jpg
    364 x 364 - 24K
    ddt2Promo.jpg
    932 x 760 - 128K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited March 2022

    dropped some balls on this 'terrain' with and without the terrain being in hi-res subDivisions ( excellent song by RUSH )

    eyeeyeLR.JPG
    1891 x 1154 - 145K
    eyeeyeAnaglyph.JPG
    905 x 1073 - 64K
    Post edited by mCasual on
  • Faeryl WomynFaeryl Womyn Posts: 3,624

    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

  • nakamuram002nakamuram002 Posts: 788
    edited March 2022

    mCausal:

    What are the differences between mcjDropToTerrain, mcjPlaceUnder, and mcjDropToTop?  They seem to perform the same function. 

    Post edited by nakamuram002 on
  • mCasualmCasual Posts: 4,607
    edited March 2022

    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

    Promo drop to terrain

     

    nakamuram002 said:

    mCausal:

    What are the differences between mcjDropToTerrain, mcjPlaceUnder, and mcjDropToTop?  They seem to perform the same function. 

    Post edited by mCasual on
  • khorneV2khorneV2 Posts: 147

    awesome and very usefull as usual yes

  • mCasual said:

    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

    Promo drop to terrain

     

    nakamuram002 said:

    mCausal:

    What are the differences between mcjDropToTerrain, mcjPlaceUnder, and mcjDropToTop?  They seem to perform the same function. 

    Thanks mCasual!!  That is what I needed to know. 

Sign In or Register to comment.