scripting the position object operator

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  01 January 2011
scripting the position object operator

I want to populate single meshes by an Position Object operator while using thousands of meshes. The problem I see: it's only possible to set all meshes at once in the flow as emitters. I tried to use a Script Operator after the Position Object operator and it really changes the Emitter Objects entry - but only when hitting the Position Object Operator in Particle View with my mouse.

So how can I update the Emitter Objects entry by scripting or alternatively: does there exist a tutorial or a script for rebuilding the Position Object Operator with MaxScript especially for using the surface of a mesh for emitting?
  01 January 2011
What did you use in your script operator? I was able to get this to work with a script operator above the position object operator. For the script, I used the below code. I was able to switch the emitter simply by changing the geoArray[x] and re-evaluating the script.
on Init pCont do 
	-- Put all objects called myGeo* into an array
	geoArray = $myGeo* as array
	-- Remove any previous emitters
	$'Position Object 01'.Emitter_Objects.count = 0
	-- Add a new emitter
	$'Position Object 01'.Emitter_Objects = #(geoArray[1])

Obviously you'd need to modify the code to match your specific needs, but this shows that the emitter can be changed without having to click on the position object node.
  01 January 2011
Sorry for waiting a few days but i had to work on commercial projects.

I've modified your little script to match my scene. Please take a look at attached file. It's my test scene which includes the pflow and my Script Operator. I agree: in general it's possible to change the emitter objects in a Position Object Operator. But the problem is: it doesn't update during playback the scene animation or moving the time slider. Currently my code is in the Proceed Pcont part. But you get the same behavior when it is in the Init Pcont part.
Attached Files
File Type: zip (34.5 KB, 7 views)
  01 January 2011
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 04:21 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.