FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
UnrealEnginePython/examples/curve_generator.py at master · luw2l/UnrealEnginePython · GitHub
luw2l
UnrealEnginePython
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
UnrealEnginePython
/
examples
/
curve_generator.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (28 loc) · 1.14 KB
Breadcrumbs
UnrealEnginePython
/
examples
/
curve_generator.py
Copy path
File metadata and controls
42 lines (28 loc) · 1.14 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
unreal_engine
as
ue
from
unreal_engine
.
classes
import
CurveFloatFactory
,
CurveVectorFactory
from
unreal_engine
.
structs
import
RichCurve
,
RichCurveKey
import
time
factory
=
CurveFloatFactory
()
curve
=
factory
.
factory_create_new
(
'/Game/CustomFloatCurve'
+
str
(
int
(
time
.
time
())))
keys
=
[]
for
i
in
range
(
0
,
100
):
keys
.
append
(
RichCurveKey
(
Time
=
i
,
Value
=
i
))
curve
.
FloatCurve
.
Keys
=
keys
curve
.
post_edit_change
()
ue
.
open_editor_for_asset
(
curve
)
factory
=
CurveVectorFactory
()
curve
=
factory
.
factory_create_new
(
'/Game/CustomVectorCurve'
+
str
(
int
(
time
.
time
())))
# one curve list for each axis
keys_x
=
[]
keys_y
=
[]
keys_z
=
[]
for
i
in
range
(
0
,
100
):
keys_x
.
append
(
RichCurveKey
(
Time
=
i
*
0.1
,
Value
=
i
*
0.1
))
keys_y
.
append
(
RichCurveKey
(
Time
=
i
*
0.1
,
Value
=
i
*
0.1
))
keys_z
.
append
(
RichCurveKey
(
Time
=
i
*
0.1
,
Value
=
i
*
0.1
))
# FloatCurves is a native array, use property index (0=x, 1=y, 2=z)
curve
.
set_property
(
'FloatCurves'
,
RichCurve
(
Keys
=
keys_x
),
0
)
curve
.
set_property
(
'FloatCurves'
,
RichCurve
(
Keys
=
keys_y
),
1
)
curve
.
set_property
(
'FloatCurves'
,
RichCurve
(
Keys
=
keys_z
),
2
)
curve
.
post_edit_change
()
ue
.
open_editor_for_asset
(
curve
)
Back
|
FazBrowse Home
|
New Git URL