forked from framefield/tooll_operators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
145c3a6b-b91f-450d-ac46-b13c66ebce19.mop
120 lines (120 loc) · 3.88 KB
/
145c3a6b-b91f-450d-ac46-b13c66ebce19.mop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
"Name": "Curve",
"_id": "145c3a6b-b91f-450d-ac46-b13c66ebce19",
"Namespace": "lib.math",
"Description": "Returns the mapped float value v regarding the input u.",
"Inputs": [
{
"Name": "U",
"MetaInstanceID": "9de89cc6-2867-4eb3-9e16-e9568d14a31e",
"DefaultValue": {
"Type": "Float",
"Value": "0"
},
"MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
"IsMultiInput": "False",
"Relevance": "Required",
"Description": "Float value to be mapped.",
"Min": "-100000",
"Max": "100000",
"Scale": "1",
"ScaleType": "Linear",
"EnumValues": []
}
],
"Outputs": [
{
"Name": "V",
"MetaInstanceID": "fccdfff4-07c3-4c5c-9b4c-9a62c7ad7d66",
"MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506"
}
],
"OperatorParts": [
{
"MetaInstanceID": "3d314c47-8600-4b64-aea6-b972c28c17bd",
"MetaID": "49163ffa-f4e9-406f-8b5c-602c6adc276f",
"Name": "CurveFunc",
"Version": "cc3d1131-4962-4c7d-95ce-7e77fb0cd22b",
"Type": "Float",
"IsMultiInput": "True",
"Script": [
"//>>> _using",
"using System;",
"using System.Collections.Generic;",
"using System.Linq;",
"using System.Text;",
"using SharpDX;",
"using SharpDX.Direct3D11;",
"using SharpDX.Windows;",
"//<<< _using",
"using Framefield.Core.Curve;",
"",
"namespace Framefield.Core.ID49163ffa_f4e9_406f_8b5c_602c6adc276f",
"{",
" public class Class_Curve : Curve.Curve",
" {",
" //>>> _inputids",
" private enum InputId",
" {",
" U = 0",
" }",
" //<<< _inputids",
"",
" public override OperatorPartContext Eval(OperatorPartContext context, List<OperatorPart> inputs, int outputIdx)",
" {",
" //>>> _params",
" var U = inputs[(int)InputId.U].Eval(context).Value;",
" //<<< _params",
"",
" context.Value = (float)GetSampledValue(U);",
" return context;",
" }",
"",
" public Class_Curve() {",
" ChangedEventEnabled = true;",
" }",
"",
" private CurveState State",
" {",
" get",
" {",
" try",
" {",
" return OperatorPart.Parent.GetOperatorPartState(OperatorPart.ID) as CurveState;",
" }",
" catch (Exception ex)",
" {",
" Logger.Error(this,\"could not get the CurveState for this Curve op: {0}\", ex.Message);",
" }",
" return null;",
" }",
" }",
" }",
"",
" //only here so that an operatorpartstate can be found",
" //and created",
" public class CurveState : Curve.CurveState",
" {",
" }",
"} ",
""
],
"AdditionalAssemblies": []
}
],
"Operators": [],
"Connections": [
{
"SourceOp": "00000000-0000-0000-0000-000000000000",
"SourceOpPart": "9de89cc6-2867-4eb3-9e16-e9568d14a31e",
"TargetOp": "00000000-0000-0000-0000-000000000000",
"TargetOpPart": "3d314c47-8600-4b64-aea6-b972c28c17bd"
},
{
"SourceOp": "00000000-0000-0000-0000-000000000000",
"SourceOpPart": "3d314c47-8600-4b64-aea6-b972c28c17bd",
"TargetOp": "00000000-0000-0000-0000-000000000000",
"TargetOpPart": "fccdfff4-07c3-4c5c-9b4c-9a62c7ad7d66"
}
]
}