public static void Submit(P3dCommand command, P3dModel model, P3dPaintableTexture paintableTexture, bool preview) { var copy = command.SpawnCopy(); copy.Model = model; copy.Groups = -1; copy.Preview = preview; paintableTexture.AddCommand(copy); }
public static void SubmitAll(P3dCommand command, bool preview, int layerMask, int groupMask, P3dModel model = null, P3dPaintableTexture paintableTexture = null, List <P3dTransform> repeaters = null, List <P3dCommand> commands = null) { command.Model = null; command.Groups = groupMask; command.Preview = preview; if (commands != null) { commands.Add(command.SpawnCopy()); // Repeat paint? BuildRepeaters(command.Matrix, repeaters); for (var r = 0; r < RepeaterCount; r++) { for (var m = 0; m < MatrixCount; m++) { command.SetLocation(Repeat(r, m)); commands.Add(command.SpawnCopy()); } } } else { SubmitAll(command, preview, layerMask, groupMask, model, paintableTexture); // Repeat paint? BuildRepeaters(command.Matrix); for (var r = 0; r < RepeaterCount; r++) { for (var m = 0; m < MatrixCount; m++) { command.SetLocation(Repeat(r, m)); SubmitAll(command, preview, layerMask, groupMask, model, paintableTexture); } } } }
public static void Submit(P3dCommand command, P3dModel model, P3dPaintableTexture paintableTexture) { var copy = command.SpawnCopy(); if (copy.Blend.Index == P3dBlendMode.REPLACE_ORIGINAL) { copy.Blend.Color = paintableTexture.Color; copy.Blend.Texture = paintableTexture.Texture; } paintableTexture.AddCommand(copy); }
public static P3dCommand Submit(P3dCommand command, P3dModel model, P3dPaintableTexture paintableTexture) { var copy = command.SpawnCopy(); copy.Apply(paintableTexture); copy.Model = model; copy.Submesh = model.GetSubmesh(paintableTexture); paintableTexture.AddCommand(copy); return(copy); }
public static void Submit(P3dCommand command, P3dModel model, P3dPaintableTexture paintableTexture, bool preview) { var copy = command.SpawnCopy(); copy.Model = model; copy.Groups = -1; copy.Preview = preview; if (copy.Blend.Index == P3dBlendMode.REPLACE_ORIGINAL) { copy.Blend.Color = paintableTexture.Color; copy.Blend.Texture = paintableTexture.Texture; } paintableTexture.AddCommand(copy); }
public static void SubmitAll(P3dCommand command, Vector3 position, float radius, int layerMask, P3dGroup group, P3dModel targetModel, P3dPaintableTexture targetTexture) { DoSubmitAll(command, position, radius, layerMask, group, targetModel, targetTexture); // Repeat paint? P3dClone.BuildCloners(); for (var c = 0; c < P3dClone.ClonerCount; c++) { for (var m = 0; m < P3dClone.MatrixCount; m++) { var copy = command.SpawnCopy(); P3dClone.Clone(copy, c, m); DoSubmitAll(copy, position, radius, layerMask, group, targetModel, targetTexture); copy.Pool(); } } }
/// <summary>This will add a paint command to this texture's paint stack. The paint stack will be executed at the end of the current frame.</summary> public void AddCommand(P3dCommand command) { // If this is a real paint command, strip out all previously added preview commands if (command.Preview == false) { for (var i = commands.Count - 1; i >= 0; i--) { var lastCommand = commands[i]; if (lastCommand.Preview == false) { break; } lastCommand.Pool(); commands.RemoveAt(i); } } commands.Add(command); if (state == StateType.LocalCommandCopy && command.Preview == false) { var localCommand = command.SpawnCopy(); localCommand.Matrix = transform.worldToLocalMatrix * localCommand.Matrix; localCommands.Add(localCommand); } if (OnAddCommand != null) { OnAddCommand(command); } }