Beispiel #1
0
        public SceneContainer FuseefyScene(BaseDocument doc, string sceneRootDir, out List <string> textureFiles)
        {
            _animationsPresent = false;
            _materialCache     = new Dictionary <long, MaterialComponent>();
            _sceneRootDir      = sceneRootDir;
            _doc           = doc;
            _weightManager = new WeightManager(_doc);

            Logger.Debug("Fuseefy Me!");

            String userName;

            using (BaseContainer machineFeatures = C4dApi.GetMachineFeatures())
            {
                GeData userNameData = machineFeatures.GetDataPointer(C4dApi.MACHINEINFO_USERNAME);
                userName = userNameData.GetString();
            }

            SceneContainer root = new SceneContainer()
            {
                Header = new SceneHeader()
                {
                    CreatedBy    = userName,
                    Generator    = "FUSEE Export Plugin for Cinema4D",
                    Version      = 1,
                    CreationDate = DateTime.Now.ToString("d-MMM-yyyy", CultureInfo.CreateSpecificCulture("en-US"))
                },

                Children = FuseefyOb(_doc.GetFirstObject()),
            };

            // CreateWeightMap has to be called after creating the object-tree
            _weightManager.CreateWeightMap();
            textureFiles = _textureFiles;
            return(root);
        }