Itoo Software Forum

Author Topic: Maxscript: Get number of geometry objects  (Read 5371 times)

jonavark

  • Jr. Member
  • **
  • Posts: 60
Maxscript: Get number of geometry objects
« on: March 21, 2012, 12:38:17 AM »
How do I get the number of objects in the "Geometry List" of a forest object?

Also.. is there a doc or method to show all of the parameters exposed through maxscript?
« Last Edit: March 21, 2012, 01:06:10 AM by jonavark »

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Maxscript: Get number of geometry objects
« Reply #1 on: March 21, 2012, 08:44:29 AM »

The Geometry List is stored in several parameters (one by property) with the suffix "list". You can use any of them to see the number of elements. In this way:

$Forest01.namelist.count

The exposed parameters of any object can be listed with:

showproperties $Forest01

We also have implemented a couple of custom interfaces: "Trees", to edit the items in Custom Edit mode, and "Catalog" (for internal use):

showinterfaces $Forest01

You can find a brief description of the "Trees" interface here.

http://www.itoosoft.com/forestpack/reference/install.php

There are some Maxscript samples posted in the forum. Please, use the Search function to locate them.

Carlos Quintero
iToo Software

jonavark

  • Jr. Member
  • **
  • Posts: 60
Re: Maxscript: Get number of geometry objects
« Reply #2 on: March 21, 2012, 05:57:37 PM »
I did look at the link but it is only a partial list?

Thanks for the quick response. You guys are the best. I will look into what you have posted. Oddly.. I think I had that info a couple of months ago when I was coding some other scripts for FP.. fell right out of my brain though!


Thanks again.

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Maxscript: Get number of geometry objects
« Reply #3 on: March 21, 2012, 06:10:34 PM »

Yes, the list is not complete because we add new parameters frequently. It is better to use showproperties to see the latest version.

Carlos Quintero
iToo Software

jonavark

  • Jr. Member
  • **
  • Posts: 60
Re: Maxscript: Get number of geometry objects
« Reply #4 on: March 21, 2012, 07:12:32 PM »
ok.. will do

What I am attempting is to script mixAmount in blend materials for all items in the geometry list. I have setup the materials as blends with a Matte/Shadow/reflection at the 100% setting.

The FP objects are "Wheat Strip 001", 002 etc..

Code: [Select]
for s in $'Wheat Strip*' do
(
print s.name
for i=1 to s.namelist.count do -- 5 tree layers in my FP object
(
s.material[i].mixAmount =100.0
)

)


It works for the first four items but fails on the fifth with:

Unknown property: "mixAmount" in Color ID 0:Standard

so it seems it attempts to set the mixamount in a colorID map instead..



iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Maxscript: Get number of geometry objects
« Reply #5 on: March 22, 2012, 09:15:33 AM »

You are changing the sub-materials of the Forest automaterial (which includes one additional material for each color ID).

The right way should be to use "matlist" parameter, it stores the materials of the Geometry List (the automaterial uses instances of these).

Carlos Quintero
iToo Software

jonavark

  • Jr. Member
  • **
  • Posts: 60
Re: Maxscript: Get number of geometry objects
« Reply #6 on: March 22, 2012, 03:30:00 PM »
Ok.. sounds good.

However, if I have 5 items in the geometry list and I am changing the material for each one I am perplexed as to how it doesn't work.

Gonna try your method now.

Thanks again.