示例#1
0
        public void EndDraw()
        {
            if (preview.Curve.ArcLength > 2 * Width)
            {
                // store undo/redo record for new primitive
                PolyCurveSO CurveSO = preview.BuildSO(scene.DefaultCurveSOMaterial, 1.0f);
                scene.History.PushChange(
                    new AddSOChange()
                {
                    scene = scene, so = CurveSO, bKeepWorldPosition = false
                });
                scene.History.PushInteractionCheckpoint();
            }

            preview.Destroy();
            preview = null;

            SavedSettings.Save("DrawCurveTool_width", width);
        }
示例#2
0
        public static TrimLoopSO CreateFromPreview(CurvePreview preview, SOMaterial material, FScene scene)
        {
            TrimLoopSO curveSO = (TrimLoopSO)preview.BuildSO(
                (curve) => {
                TrimLoopSO so = new TrimLoopSO()
                {
                    Curve = curve
                };
                so.Create(material);
                return(so);
            }, material, 1.0f);

            scene.History.PushChange(
                new AddSOChange()
            {
                scene = scene, so = curveSO, bKeepWorldPosition = false
            });
            scene.History.PushInteractionCheckpoint();

            return(curveSO);
        }