bounding box information

Dear Team

I just started with scripting and i am wondering how to get all bounding box of all object in a scene and the material id or Object Id.

may i have a pointer of research for a newbie ???

thanks alot

dgu

Comments

Comment viewing options

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

ObjInfo function

try this function. Supports only e-poly and e-mesh objects.

fn getObjInfo =
(
	clearListener()
	local classArr = #(Editable_Mesh, Editable_Poly, PolyMeshObject)
	local PolyMtlID = polyop.getFaceMatID, MeshMtlID = getFaceMatID
	for o in geometry where (idx = findItem classArr (classOf o)) != 0 do
	(
		local supported = true, facesCount = o.faces.count, idArr = #()
		for i = 1 to facesCount do 
		(
			idNum = if idx == 1 then MeshMtlID o i else PolyMtlID o i 
			if finditem idArr idNum == 0 do append idArr idNum
		)
		sort idArr
		format "Object: % ; bBox:% ; ObjID: % ; MtlID's: % \n" o.name (nodeLocalBoundingBox o) (o.gbufferchannel) idArr
	)
)
getObjInfo()

bga

dgu's picture

thanks alot , that is very

thanks alot , that is very helpfull

david

Comment viewing options

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