Itoo Software Forum

Forest Pack => Forest Pro (*) => Topic started by: cc8boy on March 28, 2015, 09:41:31 AM

Title: How to get the current actural local scale of the Nth tree via MAXscript?
Post by: cc8boy on March 28, 2015, 09:41:31 AM
Hi iToosoft,
My forest object was in "Generate Mode" in Tree Editor tab. The Scale of the trees was controlled by a greyscale map with animation.
I want to get the current actual local scale of the Nth Tree in this forest object. Can you show me a example command in MAXscript ?

FP 4.3.6 MAX2012 64bit
Title: Re: How to get the current actural local scale of the Nth tree via MAXscript?
Post by: iToo on March 28, 2015, 02:30:26 PM
Hi, you can get the size of an item using: $.getsize n

Where n is the item's index (starting from zero). Note that this interface was designed for Custom Edit mode, because in Generate mode the index of each element is not fixed and may change.
Also, the value returned is the size before applying random transformations. To get the final size, it's necessary to "store" the random transfomation in the item using Tree Editor->Store Transform (http://docs.itoosoft.com/display/FORESTPACK/Tree+Editor), and then read the value.

On the other hand, Forest Tools includes a powerful utility to export all item properties in XML format. You can find it here (http://docs.itoosoft.com/display/FORESTPACK/Forest+Tools#ForestTools-ToexportXMLdata). I hope that helps.
Title: Re: How to get the current actural local scale of the Nth tree via MAXscript?
Post by: cc8boy on March 29, 2015, 11:23:11 AM
I know the  the index of each element is not fixed and may change. My main purpose is to get the actual local scale(not world size of the trees)of the Nth (any value) tree in Generate mode dynamically via MAXscript.
I want to write some special MAXscripts.
It's meaningless if I turn the Generate mode to Custom Edit mode,  especially writing the scale value to XML file.
Title: Re: How to get the current actural local scale of the Nth tree via MAXscript?
Post by: iToo on March 30, 2015, 10:59:14 AM
If the index is not important, you would use both (Maxscript interface and XML tool) with Generate mode.
The XML exporter can be invoked from Maxscript as well, in the following way. It's is applied to the selected Forest objects (don't use $ here):

Forest_Pro.ForestPack.exportData <xml file> <list of fields separated by spaces>

In this case, the "scale" field returns exactly the value you need:

Forest_Pro.ForestPack.exportData "c:\\fpData.xml" "index scale"
Title: Re: How to get the current actural local scale of the Nth tree via MAXscript?
Post by: cc8boy on March 30, 2015, 05:46:22 PM
Thank you very much. That's what I need. By the way, where can I find the entire detail help of MAXscript of Forest Pro pack and Railclone Pro ?
There are only a few Maxscript commands in the file "Forest Pack Documentation-v18-20141217_1012.pdf" and the Orginal Railclone help.
Title: Re: How to get the current actural local scale of the Nth tree via MAXscript?
Post by: iToo on March 31, 2015, 09:10:16 AM
I am glad to have been helpful.

Regarding Maxscript, i'm afraid there is not a detailed list with all commands. Most of them were included along versions to fulfil specific needs (for customers or internal use).
You can list them using:

showinterfaces Forest_Pro
showinterfaces RailClone_Pro

Although in Forest only "trees" and "ForestPack.exportData" are useful to be used from Maxscript. In RailClone all commands are for internal use.