Skip to content

Commit

Permalink
[VFX] Fix package in isolation (to 2019.2) (Unity-Technologies#3759)
Browse files Browse the repository at this point in the history
* Fix package isolation :
- Add DummyTest for Editor & Runtime
- Add menu entry to clear runtime data

* Fix unexpected automatic compilation coming afterwards

* Clear runtimeData

* Backport commit 23bad2d00a4862264400ecbd1e219f0742eaae01 from @iTris666 to recompile automatically fx while creating a new one

* Remove unexpected m_InitialEventName (was on wrong c++ branch)

* Revert unexpect GraphVersion changed

* Add missing GPUEventRate.cs.meta (copying value from 17_GPUEvent_Simple.vfx)
  • Loading branch information
PaulDemeulenaere authored and julienf-unity committed Jun 11, 2019
1 parent 7393732 commit d67491d
Show file tree
Hide file tree
Showing 18 changed files with 552 additions and 2,184 deletions.
2 changes: 2 additions & 0 deletions com.unity.visualeffectgraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [6.8.0-preview] - 2019-XX-XX
### Added
- Subgraphs.
- auto recompile new vfx

## [6.7.0-preview] - 2019-05-21
### Added
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 28 additions & 2 deletions com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ namespace UnityEditor.VFX
{
public class VFXCacheManager : EditorWindow
{
[MenuItem("Edit/Visual Effects//Rebuild All Visual Effect Graphs", priority = 320)]
public static void Build()
private static List<VisualEffectAsset> GetAllVisualEffectAssets()
{
var vfxAssets = new List<VisualEffectAsset>();
var vfxAssetsGuid = AssetDatabase.FindAssets("t:VisualEffectAsset");
Expand All @@ -29,7 +28,13 @@ public static void Build()
vfxAssets.Add(vfxAsset);
}
}
return vfxAssets;
}

[MenuItem("Edit/Visual Effects//Rebuild All Visual Effect Graphs", priority = 320)]
public static void Build()
{
var vfxAssets = GetAllVisualEffectAssets();
foreach (var vfxAsset in vfxAssets)
{
if (VFXViewPreference.advancedLogs)
Expand All @@ -41,6 +46,27 @@ public static void Build()
}
AssetDatabase.SaveAssets();
}

[MenuItem("Edit/Visual Effects//Clear All Visual Effect Runtime Data", priority = 321)]
public static void ClearRuntime()
{
var vfxAssets = GetAllVisualEffectAssets();
foreach (var vfxAsset in vfxAssets)
{
if (VFXViewPreference.advancedLogs)
Debug.Log(string.Format("Clear VFX asset Runtime Data: {0} ({1})", vfxAsset, AssetDatabase.GetAssetPath(vfxAsset)));

//Prevent possible automatic compilation afterwards ClearRuntimeData
VFXExpression.ClearCache();
vfxAsset.GetResource().GetOrCreateGraph().SetExpressionGraphDirty();
vfxAsset.GetResource().GetOrCreateGraph().OnSaved();

//Now effective clear runtime data
vfxAsset.GetResource().shaderSources = new VFXShaderSourceDesc[] { }; //TODO: Should be done by ClearRuntimeData, remove this when it's fixed
vfxAsset.GetResource().ClearRuntimeData();
}
AssetDatabase.SaveAssets();
}
}

public class VisualEffectAssetModicationProcessor : UnityEditor.AssetModificationProcessor
Expand Down
385 changes: 9 additions & 376 deletions com.unity.visualeffectgraph/Editor/Templates/Empty Particle System.vfx

Large diffs are not rendered by default.

0 comments on commit d67491d

Please sign in to comment.