Notifications
Clear all

[Closed] Fastest Way to grab every Nth Face from multiple meshes….?

Hi Branko,

Thank you for the reorganization. Two things I noticed without testing it:

for node in nodes where canconvertto node editable_mesh do
  (
  	node = snapshotasmesh node
  	append array node
  	number += node.numfaces
  )

#1. Splines can also convert to editable_mesh
#2. Collecting the Snapshots was my original approach and it worked well with the 8 Million Tris scene. But testing it with a very large scene I realized I don’t really want to put 10 thousand objects with 100 Million Tris into an array.

For #1 you are right. But because this statement need to check only one time then defining filter function is is not required. We can use simply:

for node in nodes where iskindof node geometryclass and canconvertto node editable_mesh...
 --or
 for node in nodes where not iskindof node shape and canconvertto node editable_mesh...

This line cause main slowdown

for node in nodes do numfaces += node.mesh.numfaces
I just wanted to avoid repeating the same for-loop (for node in nodes...) :)

Anyway I saw the other day new version of PolyUnwrapper. Great job, man. Congrats!

Personally I have no use for this function at the moment, so I was just following what David needed, that’s the reason why I added the Validate function.

As I was testing with meshes only, at first I forgot to add the $.mesh, and was just gathering the facecount from the meshes. Then , when I added the $.mesh I did the same as you did, just getting this info from the snapshots, because (as you said) getting the mesh was slowing it down, and there was no reason for doing it if we already had the snapshot of the node.

Everything was fine in the early tests and collecting the Snapshots for 128 objects 8M Tris didn’t show any problem. But then I pushed it to 10K objects 100M Tris and
well you can guess what happened.

I thought of using getPolygonCount but it didn’t help.

If you have enough RAM it shouldn’t be a problem, but you really need to check this before processing the scene. For the 100M Tris, it takes around 4-5 GB for the scene, another 5-6 GB to hold the array of snapshots, and then you need to build the proxy mesh, which depending on the number of faces, can take up a lot of memory.

Page 2 / 2