Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Face from object array

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
571 Views, 3 Replies

Face from object array

I have a script that selects the top polygons for a few separate objects, and i want to put them all in one array/group (i don’t have a preferred choice)
After the selection happens I don’t know how to add them to a group/array (I have a for loop that goes through each object)
I can accsess the ‘selectedFaces’/polyop.getFaceSelection but i don’t know how to transfer the face to a working list
I would love some help on the topic

 

When I try and attach the face to a random editable poly it gives me this message:

– Error occurred in anonymous codeblock; filename: ; position: 36; line: 2
– Unable to convert: #faces( : $Box001) to type:
– MAXScript callstack:
– thread data: threadID:4444


– [stack level: 0]
– In top-level

 

 

thanks very much

3 REPLIES 3
Message 2 of 4
denisT.MaxDoctor
in reply to: Anonymous

Your question is not clear to me. Maybe some image may help.

Message 3 of 4
Anonymous
in reply to: denisT.MaxDoctor

polylist = polyop.getFaceSelection obj
polyOp.detachFaces obj polyList delete:true asNode:true
polyop.attach $box001 polylist

 

I want to detach the selected faces of an object, and than I want to attach them to a different object (in this case box001)

Message 4 of 4
denisT.MaxDoctor
in reply to: Anonymous

fn reattachPolyFaces source target faces: delete:on = 
(
	if faces == unsupplied do faces = target.selectedfaces as bitarray
		
	if not faces.isempty do
	(
		if (polyop.detachfaces target faces delete:delete asnode:on) do
		(
			_faces = objects[objects.count]
			polyop.attach source _faces
		)
	)
)

/*
detaches specified faces (or selected) from <target> (optional delete == ON) and attaches to <source>
using:
	reattachPolyFaces <to_poly_objects> <from_poly_object> faces:<optional bitarray> delete:<optional>
*/

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report