Beispiel #1
0
        public FaceMapItem Clone()
        {
            FaceMapItem retVal = new FaceMapItem();

            retVal.PhonemeList    = new Dictionary <string, bool>(PhonemeList);
            retVal.ElementColor   = ElementColor;
            retVal.ElementGuid    = ElementGuid;
            retVal.FaceComponents = new Dictionary <FaceComponent, bool>(FaceComponents);

            return(retVal);
        }
Beispiel #2
0
        private void BuildPropertiesFromDialog()
        {
            for (int num = 0; num < _mouthDataTable.Rows.Count; num++)
            {
                DataRow     dr           = _mouthDataTable.Rows[num];
                var         otherDataRow = _otherDataTable.Rows[num];
                string      elementName  = dr[0].ToString();
                FaceMapItem item         = new FaceMapItem();
                ElementNode node         = FindElementNode(elementName);

                FaceModule fm;
                if (node.Properties.Contains(FaceDescriptor.ModuleId))
                {
                    fm = node.Properties.Get(FaceDescriptor.ModuleId) as FaceModule;
                }
                else
                {
                    fm = node.Properties.Add(FaceDescriptor.ModuleId) as FaceModule;
                }

                if (fm == null)
                {
                    continue;
                }

                fm.PhonemeList.Clear();
                for (int theCount = 1; theCount < dr.ItemArray.Count() - 1; theCount++)
                {
                    bool checkVal = dr[theCount] is bool && (Boolean)dr[theCount];
                    fm.PhonemeList.Add(
                        dr.Table.Columns[theCount].ColumnName, checkVal
                        );
                }
                fm.DefaultColor = (System.Drawing.Color)dr[dr.ItemArray.Count() - 1];

                fm.FaceComponents.Clear();
                foreach (FaceComponent key in Enum.GetValues(typeof(FaceComponent)))
                {
                    if (key == FaceComponent.Mouth)
                    {
                        fm.FaceComponents.Add(key, item.PhonemeList.Values.Any(x => x));
                        continue;
                    }

                    var value = otherDataRow[key.GetEnumDescription()];
                    if (value is bool)
                    {
                        fm.FaceComponents.Add(key, (bool)value);
                    }
                }
            }
        }
Beispiel #3
0
 public double ConfiguredIntensity(FaceMapItem item)
 {
     return(HSV.VFromRgb(DefaultColor));
 }
Beispiel #4
0
 public double ConfiguredIntensity(FaceMapItem item)
 {
     return(1);
 }