/* ----------------------------------------------------------------------------- This source file is part of OpenSpace3D For the latest info, see http://www.openspace3d.com Copyright (c) 2012 I-maginer This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to http://www.gnu.org/copyleft/lesser.txt ----------------------------------------------------------------------------- */ fun deleteOb(inst)= 0;; fun cbDlgLoadFile(dlg, p, lp)= let p -> [inst exppath] in if (lp == nil) then nil else ( SendPluginEvent inst "Converting" nil nil; while (lp != nil) do ( SO3SceneConvertFile hd lp exppath nil; set lp = tl lp; ); SendPluginEvent inst "Converted" nil nil; ); 0;; fun cbLoad(inst, from, action, param, reply, exppath)= _DLGrflopenMulti _DLGOpenFileMulti _channel DMSwin "/" "" "3D formats\0*.3ds;*.dae;*.blend;*.obj;*.fbx;*.stl;*.dxf;\0'3D Studio'\0*.3ds\0Collada\0*.dae\0Blender\0*.blend\0Obj\0*.obj\0All\0*.*\0\0" @cbDlgLoadFile [inst exppath]; 0;; fun dropFiles(inst, viewstr, x, y, lp, exppath)= if (lp == nil) then nil else ( SendPluginEvent inst "Converting" nil nil; while (lp != nil) do ( SO3SceneConvertFile hd lp exppath nil; set lp = tl lp; ); SendPluginEvent inst "Converted" nil nil; ); 0;; fun newOb(inst)= let (getPluginInstanceParam inst "exppath") -> exppath in ( PluginRegisterAction inst "Convert" mkfun6 @cbLoad exppath; setPluginInstanceCbDropFile inst mkfun6 @dropFiles exppath; setPluginInstanceCbDel inst @deleteOb; ); 0;; fun IniPlug(file)= PlugRegister @newOb nil; setPluginEditor @dynamicedit; 0;;