Select Face Array

Hi,

I need a help in faces...
I'm trying to collect some faces, some faces have an array but I can not load the array in setSelection ...

Thanks in advanced

	prov = $.selectedFaces as integer
-- Unable to convert: #faces(181, 234, 347 : $Editable_Poly:Plane003 @ [32.705963,272.583252,0.000000]) to type: Integer
 
prov
#faces(181, 234, 347 : $Editable_Poly:Plane003 @ [32.705963,272.583252,0.000000])
 
$.EditablePoly.SetSelection #Face #{prov}
-- Unable to convert: #faces(181, 234, 347 : $Editable_Poly:Plane003 @ [32.705963,272.583252,0.000000]) to type: Integer

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

Here we go


with redraw off
(
	max create mode
	plane1 = $Plane001
	plane1Mod = plane1.modifiers[#Vol__Select]
	modNode = plane1Mod.node
	plane2 = snapshot $Plane001
	prov1 = #{} -- empty bitarray
	intersectFrames = #()
	getFaceSel = getFaceSelection
	setfmID = setFaceMatID
	for t in 0 to 50 do
	(
		at time t 
		if (intersects plane1 modNode) do append intersectFrames t	
		local selFaces = getFaceSel plane1.mesh
		if selFaces.numberset != 0 do prov1 += selFaces
 
	)
	for f in prov1 do (setfmID plane2 f 2)
	plane2 = (convertto plane2 Editable_Poly)	
	plane1.baseobject = plane2
	delete plane2
	format "frames at intersection = %\n" intersectFrames
)

barigazy

kimarotta's picture

I'm testing ... and

I'm testing ... and everything went right ... when I grow up I want to be like you ...
lol =D

very thanks

kimarotta.com.br
3d Artist  

jos's picture

lol :)

lol :)

barigazy's picture

No man i'm bad example.

No man i'm bad example. :)
And i'm not old (30) :)

barigazy

barigazy's picture

Little trick

This works with your file. Solution for Editable Poly object

with redraw off
(
	max create mode
	plane1 = $Plane001
	plane2 = snapshot $Plane001
	prov1 = #{} -- empty bitarray
	getFaceSel = getFaceSelection
	setfmID = setFaceMatID
	for t in 0 to 50 do
	(
		at time t 
		local selFaces = getFaceSel plane1.mesh
		if selFaces.numberset != 0 do prov1 += selFaces
	)
	for f in prov1 do (setfmID plane2 f 2)
	plane2 = (convertto plane2 Editable_Poly)	
	plane1.baseobject = plane2
	delete plane2
)

barigazy

kimarotta's picture

Yeah Barigazy very thanks

Yeah Barigazy very thanks your help...

kimarotta.com.br
3d Artist  

barigazy's picture

This is what you want, right?

This is what you want, right?

barigazy

kimarotta's picture

yes, I will use this

yes, I will use this separation to paint a map of footprint ... I do have one more question ... could somehow know which frame each collision that occurs?
thanks in advanced

kimarotta.com.br
3d Artist  

barigazy's picture

this works only if you use

this works only if you use editable_mesh object not editable_poly.
open the file in attachments and run this code

plane1 = $Plane001
plane2 = $Plane002
prov1 = #{} -- empty bitarray
getFaceSel = getFaceSelection
setfmID = setFaceMatID
for f in 0 to 50 do
(
--sliderTime = f
	at time f 
	local selFaces = getFaceSel plane1.mesh
	if selFaces.numberset != 0 do prov1 += selFaces
)
--uncomment *line 14* i if you want to select faces
--plane2.selectedfaces = prov1 --
for f in prov1 do setfmID plane2 f 2 
update $	

AttachmentSize
tst_vol_select_meshtest.max 396 KB

barigazy

kimarotta's picture

So, two question. when I use

So, two question.

when I use "prov = $. selectedFaces the BitArray" and then ask prov.count it returns the total number of faces and not the number of items in the array ...

.
above the editablepoly I have a Vol. Select modifier and when I use "prov = $.selectedFaces as bitarray" he can not get the selected faces anyone have any idea ?

kimarotta.com.br
3d Artist  

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.