Skip to content

Commit

Permalink
Nearly finish model save/load
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinHogera committed Aug 8, 2017
1 parent b6376e7 commit f15cd19
Show file tree
Hide file tree
Showing 37 changed files with 987 additions and 94 deletions.
2 changes: 1 addition & 1 deletion AssetLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static Texture2D LoadTexture(string textureName)
{
texture = ImportCM.CreateTexture(textureName);
}
catch
catch
{
try
{
Expand Down
4 changes: 3 additions & 1 deletion CM3D2.SceneCapture.plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ public void OnGUI()
{
// 機能有効の場合
// if( this.Enable )
if(true)

if( GizmoRender.UIVisible )
{
// 補助キーの押下有無確認
bool isCtrl = Input.GetKey( KeyCode.LeftControl ) || Input.GetKey( KeyCode.RightControl );
Expand Down Expand Up @@ -326,6 +327,7 @@ private void Initialize()
{
// 追加した光源を削除
this.envView.ClearLights(false);
this.envView.ClearModels();
}
}
catch( Exception e )
Expand Down
28 changes: 0 additions & 28 deletions DragManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,6 @@ public DragManager()
DeleteObject();
}

public bool Drag()
{
return false;
// if (goDrag == null)
// return false;

// if (!canDrag)
// return false;

// if (Input.GetMouseButtonDown(0))
// {
// inDrag = ChkObjectAndMouseOffsset();
// }
// if (Input.GetMouseButtonUp(0))
// {
// inDrag = false;
// }
// if (inDrag)
// {
// Vector3 currentScreenPoint = new Vector3(Input.mousePosition.x, Input.mousePosition.y, v3Screen.z);
// Vector3 currentPosition = Camera.main.ScreenToWorldPoint(currentScreenPoint) + v3Offset;

// goDrag.transform.position = currentPosition;
// }

// return inDrag;
}

public void SetTransform(Transform trans)
{
this.goDrag.transform.position = trans.position;
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/AnalogGlitchDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ static AnalogGlitchDef()
{
analogGlitchEffect = Util.GetComponentVar<AnalogGlitch, AnalogGlitchDef>(analogGlitchEffect);
}

scanLineJitter = 0.0f;
verticalJump = 0.0f;
horizontalShake = 0.0f;
Expand All @@ -41,6 +42,11 @@ public static void InitMemberByInstance(AnalogGlitch c)

public static void Update(AnalogGlitchPane analogGlitchPane)
{
if(analogGlitchEffect == null)
{
analogGlitchEffect = Util.GetComponentVar<AnalogGlitch, AnalogGlitchDef>(analogGlitchEffect);
}

if (Instances.needEffectWindowReload == true)
analogGlitchPane.IsEnabled = analogGlitchEffect.enabled;
else
Expand Down
5 changes: 5 additions & 0 deletions EffectDefs/AntialiasingDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public static void InitMemberByInstance(AntialiasingAsPostEffect antialiasingEff

public static void Update(AntialiasingPane antialiasingPane)
{
if(antialiasingEffect == null)
{
antialiasingEffect = Util.GetComponentVar<AntialiasingAsPostEffect, AntialiasingDef>(antialiasingEffect);
}

if (Instances.needEffectWindowReload == true)
antialiasingPane.IsEnabled = antialiasingEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/BlurDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ static BlurDef()
{
blurEffect = Util.GetComponentVar<Blur, BlurDef>(blurEffect);
}

//blurType = Blur.BlurType.StandardGauss;
downsample = 1;
blurSize = 3f;
Expand All @@ -35,6 +36,11 @@ static BlurDef()

public static void InitMemberByInstance(Blur blur)
{
if(blurEffect == null)
{
blurEffect = Util.GetComponentVar<Blur, BlurDef>(blurEffect);
}

blurIterations = blur.blurIterations;
blurSize = blur.blurSize;
downsample = blur.downsample;
Expand Down
5 changes: 5 additions & 0 deletions EffectDefs/BokehDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public static void InitMemberByInstance(Bokeh bokeh)

public static void Update(BokehPane bokehPane)
{
if(bokehEffect == null)
{
bokehEffect = Util.GetComponentVar<Bokeh, BokehDef>(bokehEffect);
}

if (Instances.needEffectWindowReload == true)
bokehPane.IsEnabled = bokehEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/ChannelSwapDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ static ChannelSwapDef()
{
channelSwapEffect = Util.GetComponentVar<ChannelSwapper, ChannelSwapDef>(channelSwapEffect);
}

redSource = ChannelSwapper.Channel.Red;
greenSource = ChannelSwapper.Channel.Green;
blueSource = ChannelSwapper.Channel.Blue;
Expand All @@ -38,6 +39,11 @@ public static void InitMemberByInstance(ChannelSwapper cs)

public static void Update(ChannelSwapPane channelSwapPane)
{
if(channelSwapEffect == null)
{
channelSwapEffect = Util.GetComponentVar<ChannelSwapper, ChannelSwapDef>(channelSwapEffect);
}

if (Instances.needEffectWindowReload == true)
channelSwapPane.IsEnabled = channelSwapEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/ColorCorrectionCurvesDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static ColorCorrectionCurvesDef()
{
colorCurvesEffect = Util.GetComponentVar<ColorCorrectionCurves, ColorCorrectionCurvesDef>(colorCurvesEffect);
}

mode = ColorCorrectionMode.Simple;
selectiveCc = false;
saturation = 1f;
Expand Down Expand Up @@ -101,6 +102,11 @@ public static void InitExtra(ColorCorrectionCurves colorcurves)

public static void Update(ColorCorrectionCurvesPane colorCorrectionCurvesPane)
{
if(colorCurvesEffect == null)
{
colorCurvesEffect = Util.GetComponentVar<ColorCorrectionCurves, ColorCorrectionCurvesDef>(colorCurvesEffect);
}

if (Instances.needEffectWindowReload == true)
colorCorrectionCurvesPane.IsEnabled = colorCurvesEffect.enabled;
else
Expand Down
5 changes: 5 additions & 0 deletions EffectDefs/ContrastDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public static void InitMemberByInstance(ContrastEnhance c)

public static void Update(ContrastPane contrastPane)
{
if(contrastEffect == null)
{
contrastEffect = Util.GetComponentVar<ContrastEnhance, ContrastDef>(contrastEffect);
}

if (Instances.needEffectWindowReload == true)
contrastPane.IsEnabled = contrastEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/CreaseDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ static CreaseDef()
{
creaseEffect = Util.GetComponentVar<Crease, CreaseDef>(creaseEffect);
}

intensity = 0.5f;
softness = 1;
spread = 1f;
Expand All @@ -39,6 +40,11 @@ public static void InitMemberByInstance(Crease c)

public static void Update(CreasePane creasePane)
{
if(creaseEffect == null)
{
creaseEffect = Util.GetComponentVar<Crease, CreaseDef>(creaseEffect);
}

if (Instances.needEffectWindowReload == true)
creasePane.IsEnabled = creaseEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/DepthOfFieldDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static DepthOfFieldDef()
{
depthOfFieldEffect = Util.GetComponentVar<DepthOfFieldScatter, DepthOfFieldDef>(depthOfFieldEffect);
}

visualizeFocus = false;
focalLength= 10f;
focalSize = 0.05f;
Expand Down Expand Up @@ -101,6 +102,11 @@ public static void InitExtra(DepthOfFieldScatter depth)

public static void Update(DepthOfFieldPane depthOfFieldPane)
{
if(depthOfFieldEffect == null)
{
depthOfFieldEffect = Util.GetComponentVar<DepthOfFieldScatter, DepthOfFieldDef>(depthOfFieldEffect);
}

if (Instances.needEffectWindowReload == true)
depthOfFieldPane.IsEnabled = depthOfFieldEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/DigitalGlitchDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static DigitalGlitchDef()
{
digitalGlitchEffect = Util.GetComponentVar<DigitalGlitch, DigitalGlitchDef>(digitalGlitchEffect);
}

intensity = 0;
}

Expand All @@ -32,6 +33,11 @@ public static void InitMemberByInstance(DigitalGlitch d)

public static void Update(DigitalGlitchPane digitalGlitchPane)
{
if(digitalGlitchEffect == null)
{
digitalGlitchEffect = Util.GetComponentVar<DigitalGlitch, DigitalGlitchDef>(digitalGlitchEffect);
}

if (Instances.needEffectWindowReload == true)
digitalGlitchPane.IsEnabled = digitalGlitchEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/DynamicLookupDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static DynamicLookupDef()
{
dynamicLookupEffect = Util.GetComponentVar<DynamicLookup, DynamicLookupDef>(dynamicLookupEffect);
}

white = new Color(1f, 1f, 1f);
black = new Color(0f, 0f, 0f);
red = new Color(1f, 0f, 0f);
Expand All @@ -56,6 +57,11 @@ public static void InitMemberByInstance(DynamicLookup dl)

public static void Update(DynamicLookupPane dynamicLookupPane)
{
if(dynamicLookupEffect == null)
{
dynamicLookupEffect = Util.GetComponentVar<DynamicLookup, DynamicLookupDef>(dynamicLookupEffect);
}

if (Instances.needEffectWindowReload == true)
dynamicLookupPane.IsEnabled = dynamicLookupEffect.enabled;
else
Expand Down
5 changes: 5 additions & 0 deletions EffectDefs/EdgeDetectDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public static void InitMemberByInstance(EdgeDetectEffectNormals ed)

public static void Update(EdgeDetectPane edgeDetectPane)
{
if(edgeDetectEffect == null)
{
edgeDetectEffect = Util.GetComponentVar<EdgeDetectEffectNormals, EdgeDetectDef>(edgeDetectEffect);
}

if (Instances.needEffectWindowReload == true)
edgeDetectPane.IsEnabled = edgeDetectEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/FeedbackDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ static FeedbackDef()
{
feedbackEffect = Util.GetComponentVar<Feedback, FeedbackDef>(feedbackEffect);
}

color = Color.white;
offsetX = 0f;
offsetY = 0f;
Expand All @@ -47,6 +48,11 @@ public static void InitMemberByInstance(Feedback feedback)

public static void Update(FeedbackPane feedbackPane)
{
if(feedbackEffect == null)
{
feedbackEffect = Util.GetComponentVar<Feedback, FeedbackDef>(feedbackEffect);
}

if (Instances.needEffectWindowReload == true)
feedbackPane.IsEnabled = feedbackEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/FisheyeDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ static FisheyeDef()
{
fisheyeEffect = Util.GetComponentVar<Fisheye, FisheyeDef>(fisheyeEffect);
}

strengthX = 0.05f;
strengthY = 0.05f;
}
Expand All @@ -35,6 +36,11 @@ public static void InitMemberByInstance(Fisheye fish)

public static void Update(FisheyePane fisheyePane)
{
if(fisheyeEffect == null)
{
fisheyeEffect = Util.GetComponentVar<Fisheye, FisheyeDef>(fisheyeEffect);
}

if (Instances.needEffectWindowReload == true)
fisheyePane.IsEnabled = fisheyeEffect.enabled;
else
Expand Down
8 changes: 6 additions & 2 deletions EffectDefs/GrayscaleDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ internal class GrayscaleDef
{
private static GrayscaleEffect grayscaleEffect;

static GrayscaleDef()
{
static GrayscaleDef() {
if(grayscaleEffect == null)
{
grayscaleEffect = Util.GetComponentVar<GrayscaleEffect, GrayscaleEffect>(grayscaleEffect);
Expand All @@ -14,6 +13,11 @@ static GrayscaleDef()

public static void Update(GrayscalePane grayscalePane)
{
if(grayscaleEffect == null)
{
grayscaleEffect = Util.GetComponentVar<GrayscaleEffect, GrayscaleEffect>(grayscaleEffect);
}

if (Instances.needEffectWindowReload == true)
grayscalePane.IsEnabled = grayscaleEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/HueFocusDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ static HueFocusDef()
{
hueFocusEffect = Util.GetComponentVar<HueFocus, HueFocusDef>(hueFocusEffect);
}

hue = 0f;
range = 30f;
boost = 0.5f;
Expand All @@ -41,6 +42,11 @@ public static void InitMemberByInstance(HueFocus hf)

public static void Update(HueFocusPane hueFocusPane)
{
if(hueFocusEffect == null)
{
hueFocusEffect = Util.GetComponentVar<HueFocus, HueFocusDef>(hueFocusEffect);
}

if (Instances.needEffectWindowReload == true)
hueFocusPane.IsEnabled = hueFocusEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/LensDistortionBlurDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ static LensDistortionBlurDef()
{
lensDistortionBlurEffect = Util.GetComponentVar<LensDistortionBlur, LensDistortionBlurDef>(lensDistortionBlurEffect);
}

quality = LensDistortionBlur.QualityPreset.Medium;
samples = 10;
distortion = 0.2f;
Expand All @@ -44,6 +45,11 @@ public static void InitMemberByInstance(LensDistortionBlur blur)

public static void Update(LensDistortionBlurPane lensDistortionBlurPane)
{
if(lensDistortionBlurEffect == null)
{
lensDistortionBlurEffect = Util.GetComponentVar<LensDistortionBlur, LensDistortionBlurDef>(lensDistortionBlurEffect);
}

if (Instances.needEffectWindowReload == true)
lensDistortionBlurPane.IsEnabled = lensDistortionBlurEffect.enabled;
else
Expand Down
6 changes: 6 additions & 0 deletions EffectDefs/LetterboxDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ static LetterboxDef()
{
letterboxEffect = Util.GetComponentVar<Letterbox, LetterboxDef>(letterboxEffect);
}

aspectWidth = 21f;
aspectHeight = 9f;
fillColor = Color.black;
Expand All @@ -38,6 +39,11 @@ public static void InitMemberByInstance(Letterbox lb)

public static void Update(LetterboxPane letterboxPane)
{
if(letterboxEffect == null)
{
letterboxEffect = Util.GetComponentVar<Letterbox, LetterboxDef>(letterboxEffect);
}

if (Instances.needEffectWindowReload == true)
letterboxPane.IsEnabled = letterboxEffect.enabled;
else
Expand Down
Loading

0 comments on commit f15cd19

Please sign in to comment.