Reply To: Solid ops and subroutines

Home Forums Problems and solutions in GDL 3D modelling Solid ops and subroutines Reply To: Solid ops and subroutines

#4782
Nader Belal
Participant

My 2 cents,

This group structure is neither nice, nor clean, and it may cause a lot of confusion when the times arrives for code maintenance, all because the followed structure.

My solution


gosub 100

bla ... bla ... bla

end

100:

GROUP ‘things’
	etc
ENDGROUP

if something then
	GROUP ‘foo’
		etc
	ENDGROUP

	GROUP ‘bar’
		etc
	ENDGROUP
end

! -- Group placements --------------- 

if nothing then
	placegroup ‘things’

	killgroup ‘things’
end

if something then
	placegroup subgroup (addgroup (‘foo’, ’bar’), ‘things’)

	killgroup ‘things’
	killgroup ‘foo’
	killgroup ‘bar’
end

return