Itoo Software Forum

Author Topic: How to get the current actural local scale of the Nth tree via MAXscript?  (Read 1763 times)

cc8boy

  • Sr. Member
  • ****
  • Posts: 286
  • I'll do my best.Welcome to www.c7design.cn .
    • C7design
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
We are working hard in virtual effects in 3DSMAX. Welcome to our website in China.

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
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, 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. I hope that helps.
Carlos Quintero
iToo Software

cc8boy

  • Sr. Member
  • ****
  • Posts: 286
  • I'll do my best.Welcome to www.c7design.cn .
    • C7design
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.
We are working hard in virtual effects in 3DSMAX. Welcome to our website in China.

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
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"
Carlos Quintero
iToo Software

cc8boy

  • Sr. Member
  • ****
  • Posts: 286
  • I'll do my best.Welcome to www.c7design.cn .
    • C7design
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.
We are working hard in virtual effects in 3DSMAX. Welcome to our website in China.

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
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.
Carlos Quintero
iToo Software