Notifications
Clear all

[Closed] Cobwebs – download

Looks really promising, could be very useful!

Well in the back end of the code I have already made it possible to add multiple center object nodes so the web will create a circular webbing around X amount of center nodes. So that would be a nice touch. I’m going to add the dew drops as well as a pick button object to array whatever objects users want to across the webbing, and then lastly add controls for the webbing itself on the rendering side of things. Thickness and sides/segements and so on.

Aside from that I’m all ears to improvements or ideas.

I’d like to make the ui and labels make a little more sense and be a bit more userfriendly but that will come with the rewrite.

I’ve optimized PF part of point generation… to get points you don’t need to display and render them.
the optimized version looks:


global _generated_pfpoints 
fn generatePFPoints nodes amount:100 randomSeed:0 = if nodes.count > 0 do
(
	pfp = PF_Source name:"pf_points" X_Coord:0 Y_Coord:0 Quantity_Viewport:100 Show_Logo:off Show_Emitter:off
	
	particleFlow.BeginEdit()
	op1 = Birth name:"pfp_birth" amount:amount Emit_Stop:currenttime Emit_Start:currenttime
	op2 = Position_Object name:"pfp_place" Emitter_Objects:nodes Lock_On_Emitter:on Random_Seed:randomSeed

/* the test script:
on ChannelsUsed pCont do (pCont.usePosition = on) 
"
on Proceed pCont do 
(
	for k=1 to pCont.NumParticles() do _generated_pfpoints[pCont.particleIndex = k] = pCont.particlePosition
)
*/
source  = ""
source += "on ChannelsUsed pCont do (pCont.usePosition = on) 
"
source += "on Proceed pCont do for k=1 to pCont.NumParticles() do
"
source += "	_generated_pfpoints[pCont.particleIndex = k] = pCont.particlePosition
"

	op3 = Script_Test name:"pfp_test" Proceed_Script:source
	
	ev1 = Event name:"pfp_event"

	ev1.AppendAction op1
	ev1.AppendAction op2
	ev1.AppendAction op3
	
	pfp.AppendInitialActionList ev1
	particleFlow.EndEdit()
	particleFlow.delete pfp
)
	
gc()
delete objects

seed 0
amount = 200
nodes = for k=1 to 100 collect geosphere segments:8 pos:(random [-140,-140,-140] [140,140,140])
	   
t1 = timestamp()
m1 = heapfree
_generated_pfpoints = #()
generatePFPoints nodes amount:amount randomSeed:0
format "time:% memory:%
" (timestamp() - t1) (m1 - heapfree)
format "%: %" _generated_pfpoints.count _generated_pfpoints

Thanks denis,
I’m working on the rewrite now and that was the first thing I tested and made sure worked…which was getting rid of the display particles. Thanks

I’ll hopefully have the rewrite sometime by the end of the week.
So if there is anything else you come across let me know. Thanks Denis.

I was able to remove a few “update Shape” lines of code which help speed it up quite a bit as well.

As far as the radial section in the current build, that is going to get a bit of a revamp to make more sense because right now it is a bit convoluted for users to look at and mess with.

I’m making it also work on flat plane objects in the next one. Right now it can cause a freeze i do believe.

Here is a snapshot of the newer UI with the simplified radial section.
It leaves cool results by turning off radial order but using a pick object. It becomes a bias for the spider web. You can do this effect in the current build. Just turn off force radial and pick a center object.

What are some other features you guys would like to see in this?
Do you guys find it worth the time to add the spline radius and display options to the ui? I personally find it a bit redundant since it just creates a spline that you eventually have selected anyways which you then can adjust. But if it is something you guys find useful and well worth putting in then i can do so.

This is very smart suggestion.
Visual representation of Denis optimization code
I hope you don’t mind:)

1 Reply
(@jokermartini)
Joined: 11 months ago

Posts: 0

Just checked it out, great stuff Denis, surely optimized things. This will be great.

All features that you have so far are fine. But for some users many of these parameters are unknown. Maybe is now the right time to output the rich documented Help file with resulting images.

Yeah that sounds like a good idea. I do not want to flood the tool with to many things.
It is a rather solid tool as is. Some additional tweaks and a few more additions and I’d said it is a wrap.

Hey Denis,
When using your function for the particle positions, I noticed it stores the position in a global array. In the script I use the function multiple times to create arrays as needed throughout the script. Would you recommend that I create multiple global”s and pass them into the function or alter the function in a way that makes it return an array?

Do i just need to pass it into a local variable within the needed function to use the gatherer points.

global MasterPts 

MasterPts = #(1,2,3,4,5) -- run pflow function to get points for object 1
arrA = MasterPts -- store them to variable X

MasterPts = #(5,6,7,8,9,10) -- run pflow function to get points for object 2
arrB = MasterPts -- store them to variable X

clearlistener()
format "A: %" arrA
format "B: %" arrB

Lookin great dude!

Page 9 / 12