Forest Pack > Forest Pro (*)

Scripts for Forest Pack

<< < (3/17) > >>

Haider of Sweden:

--- Quote from: Paul Roberts on June 21, 2016, 11:40:23 AM ---
You could use this line of code to select all the object in the scene:

select (for s in geometry where classOf s == Forest_Pro collect s)

Alternatively you could easily  select all the Forest Objects using Forest Lister.

--- End quote ---

Both your answer helped me perfectly well.


Wish/request 2

A way to set "Auto Assign to Active View" on all forest items in the scene. I encountered huge difficulties when I was setting up a test-scene with several samples. It ended up being too many items to be renderable. I had to go through the forest objects one by one and set Auto Assign...

Screenscene vfx:
Hurray!

I was supplied a scene from another post company who'd written an instancer for maya and arnold to do digital set extensions. We'd been given a huge collection of alembic caches, texture files and a single maya file that had point helpers named after the model that should have been scattered on it. I was able to split the objects into layers based on their names and then bastardize your script to create a forest object with a tree matching the position, rotation and scale of each of the point helpers.

Now rather than 33,000+ vray proxies in my scene, I've a forest object for each of the 90 types of objects scattered in the scene and something way more manageable to deal with.

Much appreciated Paul!


--- Quote ---
-- Make a forest object to load stuff into

theForestObj = forest_Pro mode:1

-- Quick function in case I want to loop it later

function MakeForestFromSelection theForest theSel =
(
   
   for i = 1 to (theSel.count) do
   (
      
      -- All nicked from Paul roberts instances to forest script - http://forum.itoosoft.com/index.php?topic=2929.0
      
      local itemMatrix = theSel.transform
      local rot = quattoeuler (theSel.transform.rotationpart) order:5
      local newRot = [degtorad(rot.y),degtorad(rot.z),degtorad(rot.x)]
      local itemLocalBoundingBox = nodeGetBoundingBox theSel itemMatrix
      local size = (itemLocalBoundingBox[2] - itemLocalBoundingBox[1]) * itemMatrix.scalePart
      
      -- Add in a forest tree using the transform data of each selection object
      
      theForest.trees.create theSel.pos 1 1 theForest.specidlist[1]
      theForest.trees.setRotation (theForest.trees.count()-1) newrot
      theForest.trees.setSize (theForest.trees.count()-1) size
      theForest.trees.update_ui()
      theForest.trees.update()            
   )
)

-- Fly my pretties

MakeForestFromSelection theForestObj (selection as array)

--- End quote ---

Paul Roberts:
Instance lights on Forest Pack items



This script instances any object to match the position and rotation of items scattered with Forest Pack. It can be useful for distributing lights, splines, particle systems or any other non-geometric object that it not able to be scattered directly with Forest Pack

To use this script:
- NOTE: To return correct transform information, Forest Pack object must be scattering custom geometry, not using one of the built in billboard templates.
- Press the "Pick Object to instance" button and choose the object you'd like to instance, for example a light
- Make sure a Forest Object is selected.
- Click "Instances to Forest"

The new instances are created with a combination of the source object and the Forest object's names. To delete these.

- Make sure the source object is chosen using the "Pick Object to instance" button
- Select the FP object
- Click delete instanced objects.

Note: Because the delete function is using the names of the FP object and the source object you should not change their names if you would like to use the delete function.

Here's a video of it working



I hope it's useful for someone.

Many thanks!

Paul.

raistlin:
Hi Itoo

Can you add a little script to "randomize seed" a selection of multiple Forest Pack object in a click, it should be really interesting for scene that we re-use...

Cheers!

raistlin:

--- Quote from: raistlin on September 07, 2016, 09:51:26 AM ---Hi Itoo

Can you add a little script to "randomize seed" a selection of multiple Forest Pack object in a click, it should be really interesting for scene that we re-use...

Cheers!

--- End quote ---

I've done a little thing like that :

$.seed = random 1 999999

But it's really limited, because the result is apply in the same time on each forest object...
Damned...
It work, for sure... But i'm pretty sure it could be better...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version