Itoo Software Forum
Forest Pack => Forest Pro (*) => Topic started by: Shawn Olson on April 25, 2017, 03:56:55 PM
-
I need to automate some steps in a Forest pipeline and need to be able to generate a forest and populate it with an array of props.
I've been trying to manually add props by appending array properties but so far there are always issues.
Can you provide a function that would add a model to a forest in this format:
function addNodeToForest forestNode modelNode = ()
Thanks!
-
NVM, I figured it out.
For anyone else, here was a bare minimum needed to get to work (as I was needing):
function wallworm_createForest surfaces mdls:undefined uvMode:false = (
if ::Forest_Pro != undefined AND surfaces.count > 0 then (
local f = Forest_Pro()
f.surflist = surfaces
if uvMode == true then (
f.pf_aractivelist[1] = off
f.surfmode = 1
) else (
f.pf_aractivelist[1] = on
f.surfmode = 0
)
if mdls.count > 0 then (
f.cobjlist = mdls
local problist = #()
local geomlist = #()
local usemeshdimlist = #()
local namelist = #()
local tempnamelist = #()
for i = 1 to mdls.count do (
append geomlist 2
append usemeshdimlist true
append namelist mdls[i].name
append problist 100
append tempnamelist "One Plane"
)
f.tempnamelist = tempnamelist
f.geomlist =geomlist
f.usemeshdimlist = usemeshdimlist
f.namelist= namelist
f.problist = problist
)
f.units_x = 1024
f.surfanim = on
f
)
)
To print all array params:
for p in (getPropNames $) WHERE (classof (getProperty $ p)==ArrayParameter) do format "% : %\n" p (getProperty $ p)
-
That array property print script is lovely Shawn - thanks for posting it!
-
Thanks.
I had to update the script to use ::Forest_Pro instead of Forest_Pro. This can avoid some variable scope problems I discovered for people who don't have Forest.
-
Hi Guys,
I am sorry for such a question but i found this post interesting and understood half of it.
my question is how to use this script and can u provide an example with a max file to understand it more
thanks
-
I wrote the script to drop into one of my own pipelines. What I'm using it for is to select landscape areas in the scene, the models that should go on them, then pressing a button to automate setting up Forest. There will be a video demonstrating how I'm using them in the near future.