How to select faces between two loop edges by script ?

Image Hosted by ImageShack.us

like pic show

I make a gap and want to select the faces between two loop edges,

then use smooth.

How do I script it to convert looped edges selection to faces selection ?

Could someone help me, please ? \ . /

Comments

Comment viewing options

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

ur1na

pic show?Just use the slider. And @barigazy is right about it.
Like this Pic .What do you think?

barigazy's picture

solution

This function do the job

fn facesBetweenTwoLoopEdges obj = if isKindOf obj Editable_Poly do
(
	local selEdges = (obj.selectedEdges as bitarray) as array
	if selEdges.count != 0 do
	(
		local poGEF = polyop.getEdgeFaces, edgeFaces = #(), faces = #()
		for ed in se do join edgeFaces (poGEF obj ed)
		while edgeFaces.count != 0 do
		(
			idx = findItem edgeFaces edgeFaces[edgeFaces.count]
			if idx != 0 and idx != edgeFaces.count do (append faces edgeFaces[edgeFaces.count] ; deleteItem edgeFaces idx)
			deleteItem edgeFaces edgeFaces.count
		)
		obj.selectedfaces = faces
	)
)
facesBetweenTwoLoopEdges $

barigazy

ehimess's picture

Thanks a lot

Thank you sir, barigazy

When it evaluate, it has a warn in 8th line"for ed in se do join edgeFaces (poGEF obj ed)" .

Warn is " No "map" function for undefined ".

How do I do to solve it ?

barigazy's picture

:)

fn facesBetweenTwoLoopEdges obj = if isKindOf obj Editable_Poly do
(
	local selEdges = (obj.selectedEdges as bitarray) as array
	if selEdges.count != 0 do
	(
		local poGEF = polyop.getEdgeFaces, edgeFaces = #(), faces = #()
		for ed in selEdges do join edgeFaces (poGEF obj ed)
		while edgeFaces.count != 0 do
		(
			idx = findItem edgeFaces edgeFaces[edgeFaces.count]
			if idx != 0 and idx != edgeFaces.count do (append faces edgeFaces[edgeFaces.count] ; deleteItem edgeFaces idx)
			deleteItem edgeFaces edgeFaces.count
		)
		obj.selectedfaces = faces
	)
)
facesBetweenTwoLoopEdges $

barigazy

Comment viewing options

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