Notifications
Clear all

[Closed] what is this for #{}

I know #() this is for a array, but what is this used for #{}

Thanks for any help

4 Replies

Try the manual for BitArrays.

it’s an array of bits, max uses it for vert, face and edge selection for example, useful because it would take up 32 times less space than an array of ints. Also has the wonderfully useful ability of being able to perform logical operations across the whole array… for example

fn collectMeshPolys mObj =
  (
  	nfaces = meshop.getnumfaces mObj;
  	faces = #{};
  	faces.count = nfaces;
  	polys = #();
  	for f = 1 to nfaces where not faces[f] do
  	(
  		pfaces = meshop.getPolysUsingFace mObj f threshhold:180;
  		append polys pfaces;
  		faces += pfaces; -- ORs the faces bitarray with the poly faces bitarray "tagging" them so we don't have to process them again (see the for loop)
  	)		
  	polys;
  )  

I got it, great example

I’m from c/c++ so new to max script.

Thanks

however useful they are the draw backs with using bitarrays is they have only one concept of order