0
Fixed

DOTween Shortcut Extension units aren't defining

Robautomatic 2 years ago updated by Lazlo Bonin (Lead Developer) 1 year ago 8

Heya. 

Having issues with getting DOTween's modules and shortcut extensions to work in Bolt. I've read through past forum posts and I'm seeing that these are being marked as fixed but it's not the case on my end. I'm on a fresh 2018.2.11f1 (and also tested on 2018.3.6f1) project and up to date as of this morning version of DOTween Pro. The appropriate Types (and Assemblies) for DOTween are added to the Unit Options, and I checked AOT Safe Mode on and off to see if that was the problem as well. 

They show in the fuzzy finder but they are dimmed, and upon selecting any of the dimmed units, will result in a Missing Member node. 

Base DOTween function units for primitive types are showing and working alright, however. If anyone has any recent insight on this, it'd be much appreciated! Otherwise, I'll just stick to code with DOTween, which is unfortunate (as I prefer not writing a plethora of scripts for one-off tween behaviors and would rather use scene-embedded graphs).

Bolt Version:
1.4.1
Unity Version:
Both 2018.2.11f1 and 2018.3.6f1
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Pending Review

Hi Robautomatic,

After disabling AOT Safe-Mode, did you rebuild the unit options?

Hey Lazlo,

Yeah, after rebuilding the unit options it's still the same result.

Cannot Reproduce

Hi Robaumatic,

So sorry for the late reply on this.

I tried reproducing this on Unity 2018.3 and Bolt v.1.4.1 but couldn't.

  1. Added DOTween (free version from the website) to my project
  2. Opened the Unit Options Wizard
  3. Added DOTween to my assembly options
  4. Added ShortcutExtensions to my type options
  5. Regenerated

Everything seems fine:

Can you post more specific reproduction steps, or send a project that fails to support@ludiq.io?

I'm having similar issues with DotweenProShortcuts type. This is the error I get:

MissingMemberException: No matching method found: 'DOTweenProShortcuts.DOSpiral (Single, Nullable`1, SpiralMode, Single, Single, Single, Boolean)'
Ludiq.Member.ReflectMethod (System.Collections.Generic.IEnumerable`1[T] candidates) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/Member.cs:733)
Ludiq.Member.Reflect () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/Member.cs:668)
Ludiq.Member.EnsureReflected () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/Member.cs:761)
Ludiq.Member.get_source () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/Member.cs:206)
Ludiq.Member.get_info () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/Member.cs:339)
Ludiq.Member.get_declaringType () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/Member.cs:465)
Ludiq.Member.get_pseudoDeclaringType () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/Member.cs:478)
Ludiq.Member.get_isPseudoInherited () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/Member.cs:506)
Bolt.UnitOptionTree+<>c.b__51_1 (Bolt.IUnitOption option) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Editor/Options/UnitOptionTree.cs:509)
System.Linq.EnumerableSorter`2[TElement,TKey].ComputeKeys (TElement[] elements, System.Int32 count) (at :0)
System.Linq.EnumerableSorter`1[TElement].ComputeMap (TElement[] elements, System.Int32 count) (at :0)
System.Linq.EnumerableSorter`1[TElement].Sort (TElement[] elements, System.Int32 count) (at :0)
System.Linq.OrderedEnumerable`1[TElement].SortedMap (System.Linq.Buffer`1[TElement] buffer) (at :0)
System.Linq.OrderedEnumerable`1+d__3[TElement].MoveNext () (at :0)
Bolt.UnitOptionTree+d__51.MoveNext () (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Editor/Options/UnitOptionTree.cs:508)
Bolt.UnitOptionTree+d__50.MoveNext () (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Editor/Options/UnitOptionTree.cs:500)
System.Collections.Generic.LargeArrayBuilder`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] items) (at :0)
System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable`1[T] source) (at :0)
System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at :0)
Ludiq.FuzzyWindow.Populate (Ludiq.FuzzyOptionNode node, System.Collections.Generic.IEnumerable`1[T] childrenValues, System.Nullable`1[T] cancellation) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:23)
Ludiq.FuzzyWindow+<>c__DisplayClass38_0.b__0 () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:388)
Ludiq.FuzzyWindow.Work () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:1064)
UnityEngine.Debug:LogException(Exception)
Ludiq.FuzzyWindow:Work() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:1069)
System.Threading.ThreadHelper:ThreadStart)

And the same is happening with ShortcutExtensionsTMPText:



Failed to define InvokeMember#df57e...:
System.MissingMemberException: No matching method found: 'ShortcutExtensionsTMPText.DOGlowColor (Color, Single, Boolean)'
at Ludiq.Member.ReflectMethod (System.Collections.Generic.IEnumerable`1[T] candidates) [0x00038] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:733
at Ludiq.Member.Reflect () [0x001ef] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:668
at Ludiq.Member.EnsureReflected () [0x00008] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:761
at Bolt.MemberUnit.Definition () [0x00000] in C:\Users\lazlo\Projects\Bolt1\Package\Bolt.Flow\Runtime\Framework\Codebase\MemberUnit.cs:35
at Bolt.InvokeMember.Definition () [0x00000] in C:\Users\lazlo\Projects\Bolt1\Package\Bolt.Flow\Runtime\Framework\Codebase\InvokeMember.cs:69
at Bolt.Unit.Define () [0x00015] in C:\Users\lazlo\Projects\Bolt1\Package\Bolt.Flow\Runtime\Unit.cs:149
UnityEngine.Debug:LogWarning(Object)
Bolt.Unit:Define() (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Runtime/Unit.cs:158)
Bolt.UnitOption`1:InstantiateUnit() (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Editor/Options/UnitOption.cs:72)
Bolt.<>c__DisplayClass15_1:b__1(Object) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Editor/FlowCanvas.cs:238)
Ludiq.<>c__DisplayClass83_0:b__0(IFuzzyOption) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/LudiqGUI.cs:1479)
Ludiq.FuzzyWindow:SelectChild(FuzzyOptionNode) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:417)
Ludiq.FuzzyWindow:OnOptionsGUI(FuzzyOptionNode, Single) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:928)
Ludiq.FuzzyWindow:OnLevelGUI(Single, FuzzyOptionNode, FuzzyOptionNode) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:780)
Ludiq.FuzzyWindow:OnGUI() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:647)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

----

Failed to define InvokeMember#b1577...:
System.MissingMemberException: No matching method found: 'ShortcutExtensionsTMPText.DOGlowColor (Color, Single, Boolean)'
at Ludiq.Member.ReflectMethod (System.Collections.Generic.IEnumerable`1[T] candidates) [0x00038] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:733
at Ludiq.Member.Reflect () [0x001ef] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:668
at Ludiq.Member.EnsureReflected () [0x00008] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:761
at Bolt.MemberUnit.Definition () [0x00000] in C:\Users\lazlo\Projects\Bolt1\Package\Bolt.Flow\Runtime\Framework\Codebase\MemberUnit.cs:35
at Bolt.InvokeMember.Definition () [0x00000] in C:\Users\lazlo\Projects\Bolt1\Package\Bolt.Flow\Runtime\Framework\Codebase\InvokeMember.cs:69
at Bolt.Unit.Define () [0x00015] in C:\Users\lazlo\Projects\Bolt1\Package\Bolt.Flow\Runtime\Unit.cs:149
UnityEngine.Debug:LogWarning(Object)
Bolt.Unit:Define() (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Runtime/Unit.cs:158)
Bolt.Unit:AfterAdd() (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Runtime/Unit.cs:44)
Ludiq.GraphElementCollection`1:AfterAdd(IUnit) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Graphs/Runtime/GraphElementCollection.cs:46)
Ludiq.GraphElementCollection`1:InsertItem(Int32, IUnit) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Graphs/Runtime/GraphElementCollection.cs:77)
System.Collections.ObjectModel.Collection`1:Add(IUnit)
Bolt.FlowCanvas:AddUnit(IUnit, Vector2) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Editor/FlowCanvas.cs:195)
Bolt.<>c__DisplayClass15_1:b__1(Object) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Editor/FlowCanvas.cs:239)
Ludiq.<>c__DisplayClass83_0:b__0(IFuzzyOption) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/LudiqGUI.cs:1479)
Ludiq.FuzzyWindow:SelectChild(FuzzyOptionNode) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:417)
Ludiq.FuzzyWindow:OnOptionsGUI(FuzzyOptionNode, Single) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:928)
Ludiq.FuzzyWindow:OnLevelGUI(Single, FuzzyOptionNode, FuzzyOptionNode) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:780)
Ludiq.FuzzyWindow:OnGUI() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:647)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

----

Failed to check attribute condition:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMemberException: No matching method found: 'ShortcutExtensionsTMPText.DOGlowColor (Color, Single, Boolean)'
at Ludiq.Member.ReflectMethod (System.Collections.Generic.IEnumerable`1[T] candidates) [0x00038] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:733
at Ludiq.Member.Reflect () [0x001ef] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:668
at Ludiq.Member.EnsureReflected () [0x00008] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:761
at Ludiq.Member.get_source () [0x00000] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:206
at Ludiq.Member.get_requiresTarget () [0x00000] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:442
at Bolt.InvokeMember.get_supportsChaining () [0x00000] in C:\Users\lazlo\Projects\Bolt1\Package\Bolt.Flow\Runtime\Framework\Codebase\InvokeMember.cs:28
at Ludiq.InstancePropertyAccessor`2[TTarget,TProperty].GetValueUnsafe (System.Object target) [0x00000] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Optimization\InstancePropertyAccessor.cs:104
at Ludiq.InstancePropertyAccessor`2[TTarget,TProperty].GetValue (System.Object target) [0x0003b] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Optimization\InstancePropertyAccessor.cs:85
--- End of inner exception stack trace ---
at Ludiq.InstancePropertyAccessor`2[TTarget,TProperty].GetValue (System.Object target) [0x00049] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Optimization\InstancePropertyAccessor.cs:93
at Ludiq.Member.Get () [0x0006b] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:799
at Ludiq.Member.Get[T] () [0x00000] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\Member.cs:812
at Ludiq.AttributeUtility.CheckCondition (System.Type type, System.Object target, System.String conditionMemberName, System.Boolean fallback) [0x00065] in C:\Users\lazlo\Projects\Bolt1\Package\Ludiq.Core\Runtime\Reflection\AttributeUtility.cs:463
UnityEngine.Debug:LogWarning(Object)
Ludiq.AttributeUtility:CheckCondition(Type, Object, String, Boolean) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/AttributeUtility.cs:467)
Ludiq.ReflectedInspector:Include(MemberInfo) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Inspection/Special/ReflectedInspector.cs:37)
System.Collections.Generic.List`1:AddRange(IEnumerable`1)
Ludiq.ReflectedInspector:ReflectMetadata() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Inspection/Special/ReflectedInspector.cs:60)
Ludiq.ReflectedInspector:b__1_0(Type) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Inspection/Special/ReflectedInspector.cs:19)
Ludiq.Metadata:add_valueTypeChanged(Action`1) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Meta/Metadata.cs:545)
Ludiq.ReflectedInspector:Initialize() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Inspection/Special/ReflectedInspector.cs:19)
Ludiq.InspectorProvider:CreateDecorator(Type, Metadata) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Inspection/InspectorProvider.cs:19)
Ludiq.SingleDecoratorProvider`3:CreateDecorator(Metadata) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Decorators/SingleDecoratorProvider.cs:42)
Ludiq.SingleDecoratorProvider`3:GetDecorator(Metadata) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Decorators/SingleDecoratorProvider.cs:253)
Ludiq.XInspectorProvider:Inspector(Metadata) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Inspection/InspectorProvider.cs:174)
Ludiq.LudiqGUI:GetInspectorHeight(Inspector, Metadata, Single, GUIContent) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/LudiqGUI.cs:76)
Ludiq.GraphElementEditor`1:GetInspectorHeight(Single) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Graphs/Editor/Inspection/GraphElementEditor.cs:86)
Ludiq.GraphElementEditor`1:GetWrappedInspectorHeight(Single) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Graphs/Editor/Inspection/GraphElementEditor.cs:73)
Bolt.UnitEditor:GetHeight(Single, GUIContent) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Editor/Units/UnitEditor.cs:27)
Ludiq.Inspector:GetCachedHeight(Single, GUIContent, Inspector) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Inspection/Inspector.cs:192)
Ludiq.LudiqGUI:GetEditorHeight(Inspector, Metadata, Single) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/LudiqGUI.cs:96)
Ludiq.GraphInspectorPanel:GetSelectionPanelHeight(Single) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Graphs/Editor/Windows/GraphInspectorPanel.cs:118)
Ludiq.GraphInspectorPanel:GetHeight(Single) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Graphs/Editor/Windows/GraphInspectorPanel.cs:94)
Ludiq.LudiqGUIUtility:BeginScrollablePanel(Rect, Func`2, Rect&, Vector2&, RectOffset) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/LudiqGUIUtility.cs:782)
Ludiq.LudiqGUIUtility:BeginScrollableWindow(Rect, Func`2, Rect&, Vector2&) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Interface/LudiqGUIUtility.cs:821)
Ludiq.SidebarPanelWindow`1:OnGUI() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Windows/Sidebars/SidebarPanelWindow.cs:78)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Pending Review

Will have another look!

I could also reproduce the issue on a fresh project:

1. Create a new project in Unity 2019.1.11f1
2. Import Text Mesh Pro essentials
3. Set up DoTween Pro with Text Mesh Pro module enabled
4. Install Bolt 1.4.5
5. In Unit Options Wizard add everything related to Dotween in Assemblies. 
6. In Unit Types specifically add "DOTweenProShortcuts" and "ShortcutExtensionsTMPText"

DOText in ShortcutExtensionsTMPText is what I'm trying to use and it's grayed out as Robautomatic mentioned and turns red when added in graph with the errors I previously posted. 

+1
Working on Fix

Hi everyone,

Investigating this further, I realize this more of a confusion than a bug.

The "error" is that you are trying to called an extension method from the static class that defines the extension rather than from the extended class.

For example, you're calling "DO Color" from "ShortcutExtensions" instead of from "Material" or "Light".

In C# equivalence, you're trying to do:

ShortcutExtensions.DOColor(material, Color.red);

Instead of:

material.DoColor(Color.red);

Both are valid C#, but Bolt only recognizes the latter. It also gets a little confused in the fuzzy finder and unit definition when that happens. If you chose "DoColor" from the "Material" class, it shouldn't be an issue.

In v.1.4.6, I'm going to attempt to have both versions work and be properly recognized.