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 (21)
Comment policy
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
)
I'm testing ... and everything went right ... when I grow up I want to be like you ...
lol =D
very thanks
No man i'm bad example. :)
And i'm not old (30) :)
lol :)
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
)
Yeah Barigazy very thanks your help...
This is what you want, right?
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
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 $
Attachments
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 ?
First if you use array and you want to know the count then use:
But for bitarray you need to use:
bitarr = #{1..5,10,16}
bitarr.numberset
-->7
very good and very thanks Barigazy...
and the question of vol. select has any idea?
Next time say if you use modifiers or not :)
For the editpoly mod you can use various methods
Read mxs help, topic Edit_Poly : Modifier
EditPolyMod.GetSelection $.modifiers[#Edit_Poly] #Face
--or
EditPolyMod.GetSelection $.Edit_Poly #Face
--or
$.modifiers[#Edit_Poly].EditPolyMod.GetSelection #Face
--or
$.Edit_Poly.EditPolyMod.GetSelection #Face
--or
$.modifiers[#Edit_Poly].GetSelection #Face
--or
$.Edit_Poly.GetSelection #Face
Sorry... and thanks again.
Are you preparing some new script or just playing with modifiers?
Share at least one screenshoot :)
Hey... I am trying to solve a problem ... I'll try to explain ... I have a plane with a modifier "Vol.Select", and would like to collect the faces that "Vol.Select" select ... I select only the latest faces and not all. would like to create an ID for each selection group that creates the Box Plane ... you get the idea? I'm sending the file to the test ...
was trying something like...
p.s. I'm a begginer... help are welcome
Attachments
.
lol.
I will try ...
very thanks
PolyOp Method
This is the same [PolyOp Method]
prov = polyop.getFaceSelection $
polyop.setFaceSelection $ #{}
polyop.setFaceSelection $ prov
max views redraw
Swordslayer is faster :)
Cheers!
You can't convert as integer but you can convert as bitarray
prov = $.selectedFaces as bitarray
$.SetSelection #Face #{}
$.SetSelection #Face prov
Hi, did you try to cast it to bitarray? Like this: