Author Topic: Corona Scatter Maxscript  (Read 1423 times)

2022-01-05, 01:26:53

moleytron

  • Active Users
  • **
  • Posts: 16
    • View Profile
Hey Everybody!

So I am using Cscatter to randomly display a small selection of objects one at a time. I have 5 objects distributed on a plane, with Max Limit set to 1, so only one object is displayed at a time. I have then animated the seed to have the displayed object change each frame.

It would be really useful to have maxscript print the name of the single object that is displayed on each frame. I am a total maxcript novice, but have got as far as the code below. Can anybody suggest how I can do this? Many thanks in advance!

Code: [Select]
for t = animationRange.start to animationRange.end do
  (
     animate on
     (
    at time t
    (
  print $'Corona Scatter001'.scatteredObjects
    )
     )
  )

2022-01-05, 10:15:42
Reply #1

moleytron

  • Active Users
  • **
  • Posts: 16
    • View Profile
So, I've made a little progress with this. It turns out the method getModelNode doesn't give the result of the scatter, but rather it gives access to the models in the list of scattered objects. As per the code below. So this doesn't appear to be able to do what I want directly. However it seems I can add and remove items from this list dynamically. So maybe there is a way to achieve it by swapping out models in the list. I will keep trying. If anybody has any advice. I'm all ears!

The following will print the first model in the distribution list for each frame:

Code: [Select]
for t = animationRange.start to animationRange.end do
  (
     animate on
     (
    at time t
    (

  ting = ($'Corona Scatter001'.getModelNode 0).name
  print ting

 
    )
     )
  )