Chaos Scatter > [Scatter] I need help!
Corona Scatter "Distribute-on objects" and "Instanced objects" max script
Frood:
Hi,
see Maxscript Class and Object Inspector Functions. In most cases, if you want to change anything by script, select an object and type "show $". It's not hard to figure out what the properties mean or do. If you cannot find what you are searching for, check for interfaces. If you issue "showinterfaces $" while having a CScatter object selected, you will see the interfaces and the methods listed in the Wiki already mentioned by Maru. For properties of objects which are not selectable (e.g. Render Elements, objects which are properties etc.), you need to use "show" on an object reference, for example "show renderers.current" to see a list of all CoronaRenderer properties (if Corona is the currently active renderer).
Hope it helps,
Good Luck
Mstp:
--- Quote from: Frood on 2021-09-14, 09:39:24 ---Hi,
see Maxscript Class and Object Inspector Functions. In most cases, if you want to change anything by script, select an object and type "show $". It's not hard to figure out what the properties mean or do. If you cannot find what you are searching for, check for interfaces. If you issue "showinterfaces $" while having a CScatter object selected, you will see the interfaces and the methods listed in the Wiki already mentioned by Maru. For properties of objects which are not selectable (e.g. Render Elements, objects which are properties etc.), you need to use "show" on an object reference, for example "show renderers.current" to see a list of all CoronaRenderer properties (if Corona is the currently active renderer).
Hope it helps,
Good Luck
--- End quote ---
That's a huge piece of advice. Thanks a lot!
Now I'm facing a weird issue where, even when the objects appear to be assigned (they appear in the array and in the interface of the scatter), they don't show in the viewport or they show but they don't react to changes in the min/max transform settings. This doesn't happen if I manually assign the exact same objects.
Here is the code I'm using, in case anyone wants to test it to see the issue
Basically the append $.distributionobjects <appendedObject> form doesn't seem to be working
--- Code: ---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 $.scatteredobjects ScatteredObj
max zoomext sel -- zooms scatter
--- End code ---
Thanks!
Frood:
You would also have to add the distributionobjectsdensity and scatteredObjectsFrequency properties. These arrays are initially empty as well. So your code would look like this:
--- Code: ---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
--- End code ---
Good Luck
Mstp:
Hi Frood. Thank you very much for taking the time to answer again.
I arrived to the same solution and I was coming here to share it!
I basically used this code to compare every property setting in my scatter and in a correctly working one
--- Code: ---for i in 1 to (getPropNames$).count do (
print (((getPropNames($))[i]) as string + ": " + (execute ("$." + (getPropNames$)[i])) as string)
)
--- End code ---
Once again, thank you for your help!
Navigation
[0] Message Index
[*] Previous page
Go to full version