Skip to content

Commit

Permalink
cherry pick analytics issue (#13328) (#14085)
Browse files Browse the repository at this point in the history
* update

* update

* null checking

* update

* Update CoreNodeModelWpfResources.Designer.cs

Co-authored-by: pinzart <[email protected]>
  • Loading branch information
pinzart90 and pinzart authored Jun 16, 2023
1 parent f598e38 commit 3183671
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/DynamoCore/Logging/AnalyticsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ internal static bool IsADPOptedIn

internal static bool IsADPAvailable()
{
if (Analytics.DisableAnalytics ||
adpAnalyticsUI == null)
{
return false;
}

return adpAnalyticsUI.IsProviderAvailable();
}

Expand Down
3 changes: 3 additions & 0 deletions src/DynamoCore/Models/DynamoModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,9 @@ private void CheckFeatureFlagTest()
{
if (!DynamoModel.IsTestMode)
{
if (DynamoModel.FeatureFlags == null)
return;

if (DynamoModel.FeatureFlags.CheckFeatureFlag<bool>("EasterEggIcon1", false))
{
this.Logger.Log("EasterEggIcon1 is true FROM MODEL");
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCore/Scheduler/UpdateRenderPackageAsyncTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private void GetTessellationDataFromGraphicItem(Guid outputPortId, IGraphicItem
var previousMeshVertexCount = package.MeshVertexCount;

//Todo Plane tessellation needs to be handled here vs in LibG currently
bool instancingEnabled = DynamoModel.FeatureFlags.CheckFeatureFlag<bool>("graphics-primitive-instancing", false);
bool instancingEnabled = DynamoModel.FeatureFlags?.CheckFeatureFlag<bool>("graphics-primitive-instancing", false) ?? false;
if (graphicItem is Plane plane)
{
CreatePlaneTessellation(package, plane);
Expand Down
4 changes: 2 additions & 2 deletions src/DynamoCoreWpf/ViewModels/Watch3D/HelixWatch3DViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ internal virtual void AggregateRenderPackages(IEnumerable<HelixRenderPackage> pa
//If we have any line geometry that was not associated with an instance,
//remove the previously added line data from the render package so the remaining lines can be added to the scene.
if (rp.LineVertexRangesAssociatedWithInstancing.Any()
&& DynamoModel.FeatureFlags.CheckFeatureFlag<bool>("graphics-primitive-instancing", false))
&& DynamoModel.FeatureFlags?.CheckFeatureFlag<bool>("graphics-primitive-instancing", false) == true)
{
//For each range of line vertices add the line data and instances to the scene
var j = 0;
Expand Down Expand Up @@ -1880,7 +1880,7 @@ internal virtual void AggregateRenderPackages(IEnumerable<HelixRenderPackage> pa
//If we have any mesh geometry that was not associated with an instance, remove the previously added
//mesh data from the render package so the remaining mesh can be added to the scene.
if (rp.MeshVertexRangesAssociatedWithInstancing.Any()
&& DynamoModel.FeatureFlags.CheckFeatureFlag<bool>("graphics-primitive-instancing", false))
&& DynamoModel.FeatureFlags?.CheckFeatureFlag<bool>("graphics-primitive-instancing", false) == true)
{
//For each range of mesh vertices add the mesh data and instances to the scene
var j = 0;
Expand Down
3 changes: 3 additions & 0 deletions src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,9 @@ private void CheckTestFlags()
{
if (!DynamoModel.IsTestMode)
{
if (DynamoModel.FeatureFlags == null)
return;

//feature flag test.
if (DynamoModel.FeatureFlags?.CheckFeatureFlag<bool>("EasterEggIcon1", false) == true)
{
Expand Down

0 comments on commit 3183671

Please sign in to comment.