i need a global array for the script_test operator. so i use it only to collect positions and i don’t suppose to use it directly. that means you have to empty the global array before generating position and make its copy after.
_generated_pfpoints = #()
generatePFPoints nodes
my_local_array = copy _generated_pfpoints #nomap
Thanks Denis for clearing that up for me. I was unsure of how that exactly was going to work. Aside from that I’ve got a new build with a few more additions and tweaks. It runs faster and also has a more user friendly interface for better understanding. I will be sure to put together a help/example file if you guys would like one, so let me know.
thanks again for everyone’s help.
To everyone’s surprise there is another update as well.
Cobwebs Update!
The features include:
● Speed/Memory Improvements
● Updated UI
● Gravity Strength controls for each spline set
● Radial web Center options
● Location options for main strands
there is a weak place in your code. it’s the way how you generate random list of unique indexes:
fn fnRandomLimited arr usedIdx = (
numItms = arr.count
usedItm = arr[usedIdx]
num = arr[usedIdx]
while num == arr[usedIdx] do
(
num = arr[random 1 numItms]
)
return num
)
we discussed this issue on this forum and biddle found the best mxs solution:
fn shuffleIndexes count =
(
list = #()
list.count = count
for k = 1 to count do
(
i = random 1 k
list[k] = list[i]
list[i] = k
)
list
)
Good find. Thanks for the checking over the code.
I’ll look into that later this evening and implement that as well as test the speed difference for the sake of testing it.
Just for the fun of it and it may return some great results…does anyone have any ideas for ways to sort the array? Right now it is radial.
Maybe a grid sort or linear X,Y,Z or something. Just some ideas to think about, it also may not be worth really anything. Just a thought.
I was just thinking of different ways of sorting the verts to see what results we could get.
Right now when a user clicks radial order, it sorts the array of points in a circular order.
I’m really just looking for ideas, see if there would be anything that would be cool. Something that could make it look like a net rather than a web.
Speaking of sorting, is the sorting I’m doing for the radial array the best way to do it? Looking at it, it’s only testing/comparing the x and y. Thus it could cause a problem if a web is vertical on the z…
I’ve decided to post the ideas I’ve received through email and on my personal website here on cgtalk.
I recently received an interesting email from Shawn Olson which had some really cool ideas.
I have additional ideas. If it is too complex computationally, they could be optional on/off checkboxes.
“Detect Collisions” with two/three options below. The collision detection is on the current objects.
Bounce Back option. When on, make the web bounce back when hitting the geometry (creating a spline knot at the collision and then going back as if it had reached the point it otherwise would have used).
Crawl Option. When on, the web follows the surface of the geometry until reaching the target location. This could be similar to how the Guruware Ivy plugin grows across geometry… but instead of growing in a plany/vine manner, it would be straighter paths like how spiders weave webs.
These could help make some results more realistic when the current script sends the splines straight through geometry.
Just some ideas, for the community to think about. I’m not sure how I’d go about doing this type of collision,follow the surface thing. Maybe someone else can shed some light on the matter.
You might have a better way of doing this but here is particles being generated onto splines using a script operator.
Check out attachement.
i’ve looked at the radial spider web. it looks absolutely wrong. the spider web has to be spiral binded.
spider makes spiral connections first with wide space in-between. first threads are not sticky. spider uses them to travel on the web. after that it makes sticky threads between non-sticky. they are also spiral. after that it makes the center place were to seat. here is a good reference:
http://video.online.ua/27004/kak-pauk-pletet-pautinu/