Itoo Software Forum

Forest Pack => Forest Pro (*) => Topic started by: Screenscene vfx on April 24, 2017, 07:38:09 PM

Title: quick quesion - maxscript to add / edit items in the areas list?
Post by: Screenscene vfx on April 24, 2017, 07:38:09 PM
Heya folks!

I've to do a mass edit of a scene with a lot of forest objects so I can break it up to split a render for efficiency. I'm trying to script a few things to add a spline to the areas list of all the forests and use it as an exclude but I can't get forest to behave on a simple test scene. I've tried copying and pasting from the listener which has 31 entries and editing to niclude my new object as a variable name but no go. I'm mainly looking at the arnodelist and arnamelist arrays but having no luck. Any ideas? There doesn't seem to be anything in showinterfaces for addnig bits into the areas list either.

Any help much appreciated!

John
Title: Re: quick quesion - maxscript to add / edit items in the areas list?
Post by: Screenscene vfx on April 25, 2017, 11:09:33 AM
You can also tell the quality of my coding from the amount of spelling mistakes in that post :D
Title: Re: quick quesion - maxscript to add / edit items in the areas list?
Post by: Michal KarmazĂ­n on April 26, 2017, 11:02:51 AM
Hi,

To add a new Spline Area to existing Forest object, it's necessary to raise .count vales for multiple Forest properties. For example in a following way:

areasSum = $.aridlist.count

$.aridlist.count = areasSum + 1
$.pf_aractivelist.count = areasSum + 1
$.arnamelist.count = areasSum + 1
$.arnamelist[areasSum + 1] = ""
$.arnodelist.count = areasSum + 1
$.arnodenamelist.count = areasSum + 1
$.arnodenamelist[areasSum + 1] = ""
$.artypelist.count = areasSum + 1
$.arincexclist.count = areasSum + 1
$.arresollist.count = areasSum + 1
$.arslicelist.count = areasSum + 1
$.arslicetoplist.count = areasSum + 1
$.arwidthlist.count = areasSum + 1
$.armaplist.count = areasSum + 1
$.arscalelist.count = areasSum + 1
$.arthresholdlist.count = areasSum + 1
$.arselspeclist.count = areasSum + 1
$.arspeclist.count = areasSum + 1
$.arspeclist[areasSum + 1] = ""
$.arpaintlist.count = areasSum + 1
$.arflafdenslist.count = areasSum + 1
$.arflafscalist.count = areasSum + 1
$.arflinvlist.count = areasSum + 1
$.arboundchecklist.count = areasSum + 1
$.arshapelist.count = areasSum + 1
$.arobscalelist.count = areasSum + 1
$.arsurfidlist.count = areasSum + 1
$.arsurfidlist[areasSum + 1] = ""
$.arzoffset.count = areasSum + 1
$.aridlist[areasSum + 1] = areasSum + 1
$.arnamelist[areasSum + 1] = "newSplineArea"
$.arobscalelist[areasSum + 1] = 100


Then, you can add & define the spline object by:

$.arnodelist[areasSum + 1] = splineObject
$.arnamelist[areasSum + 1] = splineObject.name


and set it to the Exclude mode:

$.arincexclist[areasSum + 1] = 1

Hope that helps.

Best regards,
Title: Re: quick quesion - maxscript to add / edit items in the areas list?
Post by: Screenscene vfx on April 26, 2017, 11:15:44 AM
Just got the same Michal, it was a dumb issue with error checking on picking up the forests that got me and not the forest code itself - much appreciated for the reply and apologies for the panic on twitter to Paul!