Author Topic: ChaosScatter by maxscript  (Read 652 times)

2023-06-18, 07:45:58

SRY

  • Active Users
  • **
  • Posts: 12
    • View Profile
Code: [Select]
cs = ChaosScatter()
cs.targetNodes = #(poolface) ---one plane
cs.modelNodes = #(ball01,ball02) ---two spheres

Cannot be displayed in max scene,and I can't find them in the Modify panel. But adding it manually is normal,
Am I overlooking something?

2023-06-18, 10:18:11
Reply #1

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Never underestimate the power of a well placed level one spell.

2023-06-18, 14:00:36
Reply #2

SRY

  • Active Users
  • **
  • Posts: 12
    • View Profile
my corona version is 9.0,so it's properties are changed.The following code is not valid:
Code: [Select]
ScatteredObj= sphere radius: 1 position:[0,0,0] --ScatteredObj
b = plane length: 100 width:100 pos: [150,150,0] --distrib object

--SCATTER CREATION
Cscatter isselected: on iconsize: 50 pos: ScatteredObj.pos


--APPENDING
append $.distributionobjects b
append $.distributionobjectsdensity 1.0
append $.scatteredobjects ScatteredObj
append $.scatteredObjectsFrequency 1.0

max zoomext sel -- zooms scatter
now,they are "targetNodes" and "modelNodes", I'd like an expert to explain.

2023-06-18, 19:11:48
Reply #3

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Hi, yes, property names may have changed meanwhile, will check tomorrow.


Good luck


Never underestimate the power of a well placed level one spell.

2023-06-19, 09:02:37
Reply #4

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Hi,

yes properties changed as well as the class name. Your script would look like this now (ChaosScatter v2.4):

Code: [Select]
ScatteredObj= sphere radius: 1 position:[0,0,0] --ScatteredObj
b = plane length: 100 width:100 pos: [150,150,0] --distrib objectp

ChaosScatter isselected:on iconsize: 50 pos: ScatteredObj.pos

--APPENDING
append $.targetFactors 1
append $.targetNodes b
append $.modelfrequencies 1
append $.modelNodes ScatteredObj


If you want to see all properties of a class, use 'showclass "<classname>*.*"', so for ChaosScatter: 'showclass "ChaosScatter*.*"'.


Good Luck



Never underestimate the power of a well placed level one spell.

2023-06-19, 10:49:56
Reply #5

SRY

  • Active Users
  • **
  • Posts: 12
    • View Profile
I succeeded, but there was one small problem, the scatter is not moved, Is that so ?

2023-06-19, 11:19:00
Reply #6

SRY

  • Active Users
  • **
  • Posts: 12
    • View Profile
I create the scatter with maxscript, It cannot be modified again,Why?

2023-06-19, 11:40:27
Reply #7

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Hi,

I succeeded, but there was one small problem, the scatter is not moved, Is that so ?

it is created where you requested it: at the position of "ScatteredObj", [0,0,0] that is. If you want the ScatterObject/Icon placed at the "pool"/b-plane, then you have to use instead:

Code: [Select]
ChaosScatter isselected:on iconsize: 50 pos: b.pos

I create the scatter with maxscript, It cannot be modified again,Why?

It can for sure, but your script does not save a reference to the ScatterObject for later use. You should store a reference into a variable (MyScatter=ChaosScatter isselected:on iconsize: 50 pos:b.pos) and change the variables properties instead of using the current selection:

Code: [Select]
ScatteredObj= sphere radius: 1 position:[0,0,0] --ScatteredObj
b = plane length: 100 width:100 pos: [150,150,0] --distrib objectp

MyScatter=ChaosScatter isselected:on iconsize: 50 pos: b.pos

--APPENDING
append MyScatter.targetFactors 1
append MyScatter.targetNodes b
append MyScatter.modelfrequencies 1
append MyScatter.modelNodes ScatteredObj

You can now change the properties of 'MyScatter' every time later on. Alternatively you can access the ChaosScatter object by name. These are very basic script topics though.


Good Luck



Never underestimate the power of a well placed level one spell.

2023-06-19, 14:23:43
Reply #8

SRY

  • Active Users
  • **
  • Posts: 12
    • View Profile
I mean I choose it in the max scene,and trying to change some parameters ,doesn't work.Although I also kept the reference, I sometimes fine-tuned it in the scene,no way to change it.

2023-06-19, 14:43:43
Reply #9

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Works for me, no issues changing frequencies or adding/removing items. Can you attach the scene?


Good Luck


Never underestimate the power of a well placed level one spell.