/* Authors: Arkeon */ /* Last update: 20.03.03 */ /* Version: 1.0 */ typeof class=S;; /* ***************** */ /* Set Material TYPE */ /* ***************** */ fun setMatType (mat, b)= let M3getType session mat -> curtype in ( if curtype & MAT_TEXTURED_BIS then ( M3setType session mat MAT_TEXTURED; let M3textureBISFromMaterial session mat -> tex in M3chgMaterialTexture session mat tex; ) else if curtype & MAT_ENV && curtype & MAT_TRANSP then M3setType session mat MAT_TEXTURED|MAT_TRANSP else if curtype & MAT_ENV then M3setType session mat (M3getType session mat)|MAT_ENV else if curtype & MAT_TRANSP then M3setType session mat (M3getType session mat)|MAT_TRANSP else if curtype & MAT_LIGHT then M3setType session mat (M3getType session mat)|MAT_LIGHT else if curtype & MAT_GOURAUD then M3setType session mat (M3getType session mat)|MAT_GOURAUD else nil; ); 0 ;; /* ****** */ /* New Ob */ /* ****** */ fun newOb(o)= let _GETengineState -> state in if (state==ENGINE_HARDWARE) then _DMSevent this strcat ObName o ".OpenGlMode" nil nil else ( let M3listALLMaterials session -> l in apply_on_list l @setMatType nil; _DMSevent this strcat ObName o ".SoftMode" nil nil; ); 0 ;; fun IniPlug(file)= /*_showconsole;*/ set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @newOb nil; 0 ;;