Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About bpy environment #38

Closed
NoLookDefense opened this issue May 2, 2021 · 12 comments
Closed

About bpy environment #38

NoLookDefense opened this issue May 2, 2021 · 12 comments

Comments

@NoLookDefense
Copy link

Hey bro. I am coming again for the another problem.
I want to run the new feature which can export the mesh to .fbx file, and it seems that "bpy" package is needed to download. But when I use pip install bpy, some CMake error always occurs.
I wonder that which version of CMake you are using when you install bpy?

@Arthur151
Copy link
Owner

cmake version 3.10.2
Thanks for your attension.

@NoLookDefense
Copy link
Author

cmake version 3.10.2
Thanks for your attension.

And how about the bpy version?

@Arthur151
Copy link
Owner

bpy 2.91a0

@NoLookDefense
Copy link
Author

Complete the same. But I meet error while importing bpy. I am using ubuntu18.04 and python 3.7.10

(romp) user@user-System-Product-Name:~/Documents/ROMP/src$ python lib/utils/convert_fbx.py --input=../demo/videos/sample_video2_results/sample_video2_results.npz --output=../demo/videos/sample_video2.fbx --gender=female
Color management: using fallback mode for management
Color management: Error could not find role data role.
BLT_lang_init: 'locale' data path for translations not found, continuing
Color management: scene view "Filmic" not found, setting default "Standard".
blf_load_font_default: 'fonts' data path not found for 'droidsans.ttf', will not be able to display text
blf_load_font_default: 'fonts' data path not found for 'bmonofont-i18n.ttf', will not be able to display text
blf_load_font_default: 'fonts' data path not found for 'bmonofont-i18n.ttf', will not be able to display text
bpy: couldn't find 'scripts/modules', blender probably wont start.
Freestyle: couldn't find 'scripts/freestyle/modules', Freestyle won't work properly.
ModuleNotFoundError: No module named 'bpy_types'
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): /Blender/blender/source/blender/python/intern/bpy_rna.c:7236 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): /Blender/blender/source/blender/python/intern/bpy_rna.c:7236 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): /Blender/blender/source/blender/python/intern/bpy_rna.c:7236 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): /Blender/blender/source/blender/python/intern/bpy_rna.c:7236 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): /Blender/blender/source/blender/python/intern/bpy_rna.c:7236 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): /Blender/blender/source/blender/python/intern/bpy_rna.c:7236 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): /Blender/blender/source/blender/python/intern/bpy_rna.c:7236 pyrna_srna_ExternalType: failed to find 'bpy_types' module
F0507 10:25:17.279358 13523 utilities.cc:346] Check failed: !IsGoogleLoggingInitialized() You called InitGoogleLogging() twice!
*** Check failure stack trace: ***
@ 0x7f64758057dd google::LogMessage::Fail()
@ 0x7f64758076e3 google::LogMessage::SendToLog()
@ 0x7f647580536d google::LogMessage::Flush()
@ 0x7f6475807fb9 google::LogMessageFatal::~LogMessageFatal()
@ 0x7f647580c6aa google::glog_internal_namespace_::InitGoogleLoggingUtilities()
@ 0x7f6474fee519 libmv_initLogging
@ 0x7f64742b5767 main_python_enter
@ 0x7f647493f25b bpy_module_delay_init
@ 0x7f647493f29d dealloc_obj_dealloc
@ 0x55946d3aeda2 PyDict_SetItem
@ 0x55946d3af86f PyDict_SetItemString
@ 0x55946d3b03cb PyModule_AddObject
@ 0x55946d47a821 _PyImport_LoadDynamicModuleWithSpec
@ 0x55946d47a9a9 _imp_create_dynamic
@ 0x55946d3816a2 _PyMethodDef_RawFastCallDict
@ 0x55946d3817c1 _PyCFunction_FastCallDict
@ 0x55946d41dbd9 _PyEval_EvalFrameDefault
@ 0x55946d35fd09 _PyEval_EvalCodeWithName
@ 0x55946d3b00b7 _PyFunction_FastCallKeywords
@ 0x55946d41cae9 _PyEval_EvalFrameDefault
@ 0x55946d3afe2b _PyFunction_FastCallKeywords
@ 0x55946d4186f0 _PyEval_EvalFrameDefault
@ 0x55946d3afe2b _PyFunction_FastCallKeywords
@ 0x55946d418466 _PyEval_EvalFrameDefault
@ 0x55946d3afe2b _PyFunction_FastCallKeywords
@ 0x55946d418466 _PyEval_EvalFrameDefault
@ 0x55946d3afe2b _PyFunction_FastCallKeywords
@ 0x55946d418466 _PyEval_EvalFrameDefault
@ 0x55946d360d2b _PyFunction_FastCallDict
@ 0x55946d37fa9e object_vacall
@ 0x55946d3d9c0d _PyObject_CallMethodIdObjArgs
@ 0x55946d36948c PyImport_ImportModuleLevelObject
Aborted (core dumped)

Have you met such a problem before?

@Arthur151
Copy link
Owner

Arthur151 commented May 7, 2021

It is the bug of bpy. I have also met this before.
Here is a solution that worked for me.
Besides, according to the official instruction, the correct installation might be:
pip install bpy && bpy_post_install

@NoLookDefense
Copy link
Author

Thank you. It works.
It seems that the functions have been achieved. But there is an error at the final stage.

(romp) user@jack-System-Product-Name:~/Documents/ROMP/src$ python lib/utils/convert_fbx.py --input=../demo/videos/sample_video2_results/sample_video2_results.npz --output=../demo/videos/sample_video2.fbx --gender=female
Input path: /home/jack/Documents/ROMP/src/../demo/videos/sample_video2_results/sample_video2_results.npz
Output path: /home/jack/Documents/ROMP/src/../demo/videos/sample_video2.fbx
Processing: /home/jack/Documents/ROMP/src/../demo/videos/sample_video2_results/sample_video2_results.npz
Gender: female
Number of source poses: 300
Source frames-per-second: 30
Target frames-per-second: 30

Info: Deleted 1 object(s)
Info: Deleted 1 object(s)
FBX Import: start importing /home/jack/Documents/ROMP/SMPL_unity_v.1.0.0/smpl/Models/SMPL_f_unityDoubleBlends_lbs_10_scale5_207_v1.0.0.fbx
FBX version: 7400
FBX import: Prepare...
Done (0.000194 sec)

FBX import: Templates...
Done (0.000047 sec)

FBX import: Nodes...
Done (0.000667 sec)

FBX import: Connections...
Done (0.000859 sec)

FBX import: Meshes...
Done (0.226416 sec)

FBX import: Materials & Textures...
Done (0.001190 sec)

FBX import: Cameras & Lamps...
Done (0.000228 sec)

FBX import: Objects & Armatures...
Done (0.036765 sec)

FBX import: ShapeKeys...
Done (6.289168 sec)

FBX import: Animations...
Done (0.000437 sec)

FBX import: Assign materials...
Done (0.000218 sec)

FBX import: Assign textures...
Done (0.000172 sec)

FBX import: Cycles z-offset workaround...
Done (0.000020 sec)

Done (7.024382 sec)

Import finished.
Adding pose: 0
/home/jack/anaconda3/envs/romp/lib/python3.7/site-packages/numpy/core/_asarray.py:102: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
return array(a, dtype, copy=False, order=order)
Adding pose: 1
Adding pose: 2
Adding pose: 3
Adding pose: 4
Adding pose: 5
Adding pose: 6
Adding pose: 7
Adding pose: 8
Adding pose: 9
Adding pose: 10
Adding pose: 11
Adding pose: 12
Adding pose: 13
Adding pose: 14
Adding pose: 15
Adding pose: 16
Adding pose: 17
Adding pose: 18
Adding pose: 19
Adding pose: 20
Adding pose: 21
Adding pose: 22
Adding pose: 23
Adding pose: 24
Adding pose: 25
Adding pose: 26
Adding pose: 27
Adding pose: 28
Adding pose: 29
Adding pose: 30
Adding pose: 31
Adding pose: 32
Adding pose: 33
Adding pose: 34
Adding pose: 35
Adding pose: 36
Adding pose: 37
Adding pose: 38
Adding pose: 39
Adding pose: 40
Adding pose: 41
Adding pose: 42
Adding pose: 43
Adding pose: 44
Adding pose: 45
Adding pose: 46
Adding pose: 47
Adding pose: 48
Adding pose: 49
Adding pose: 50
Adding pose: 51
Adding pose: 52
Adding pose: 53
Adding pose: 54
Adding pose: 55
Adding pose: 56
Adding pose: 57
Adding pose: 58
Adding pose: 59
Adding pose: 60
Adding pose: 61
Adding pose: 62
Adding pose: 63
Adding pose: 64
Adding pose: 65
Adding pose: 66
Adding pose: 67
Adding pose: 68
Adding pose: 69
Adding pose: 70
Adding pose: 71
Adding pose: 72
Adding pose: 73
Adding pose: 74
Adding pose: 75
Adding pose: 76
Adding pose: 77
Adding pose: 78
Adding pose: 79
Adding pose: 80
Adding pose: 81
Adding pose: 82
Adding pose: 83
Adding pose: 84
Adding pose: 85
Adding pose: 86
Adding pose: 87
Adding pose: 88
Adding pose: 89
Adding pose: 90
Adding pose: 91
Adding pose: 92
Adding pose: 93
Adding pose: 94
Adding pose: 95
Adding pose: 96
Adding pose: 97
Adding pose: 98
Adding pose: 99
Adding pose: 100
Adding pose: 101
Adding pose: 102
Adding pose: 103
Adding pose: 104
Adding pose: 105
Adding pose: 106
Adding pose: 107
Adding pose: 108
Adding pose: 109
Adding pose: 110
Adding pose: 111
Adding pose: 112
Adding pose: 113
Adding pose: 114
Adding pose: 115
Adding pose: 116
Adding pose: 117
Adding pose: 118
Adding pose: 119
Adding pose: 120
Adding pose: 121
Adding pose: 122
Adding pose: 123
Adding pose: 124
Adding pose: 125
Adding pose: 126
Adding pose: 127
Adding pose: 128
Adding pose: 129
Adding pose: 130
Adding pose: 131
Adding pose: 132
Adding pose: 133
Adding pose: 134
Adding pose: 135
Adding pose: 136
Adding pose: 137
Adding pose: 138
Adding pose: 139
Adding pose: 140
Adding pose: 141
Adding pose: 142
Adding pose: 143
Adding pose: 144
Adding pose: 145
Adding pose: 146
Adding pose: 147
Adding pose: 148
Adding pose: 149
Adding pose: 150
Adding pose: 151
Adding pose: 152
Adding pose: 153
Adding pose: 154
Adding pose: 155
Adding pose: 156
Adding pose: 157
Adding pose: 158
Adding pose: 159
Adding pose: 160
Adding pose: 161
Adding pose: 162
Adding pose: 163
Adding pose: 164
Adding pose: 165
Adding pose: 166
Adding pose: 167
Adding pose: 168
Adding pose: 169
Adding pose: 170
Adding pose: 171
Adding pose: 172
Adding pose: 173
Adding pose: 174
Adding pose: 175
Adding pose: 176
Adding pose: 177
Adding pose: 178
Adding pose: 179
Adding pose: 180
Adding pose: 181
Adding pose: 182
Adding pose: 183
Adding pose: 184
Adding pose: 185
Adding pose: 186
Adding pose: 187
Adding pose: 188
Adding pose: 189
Adding pose: 190
Adding pose: 191
Adding pose: 192
Adding pose: 193
Adding pose: 194
Adding pose: 195
Adding pose: 196
Adding pose: 197
Adding pose: 198
Adding pose: 199
Adding pose: 200
Adding pose: 201
Adding pose: 202
Adding pose: 203
Adding pose: 204
Adding pose: 205
Adding pose: 206
Adding pose: 207
Adding pose: 208
Adding pose: 209
Adding pose: 210
Adding pose: 211
Adding pose: 212
Adding pose: 213
Adding pose: 214
Adding pose: 215
Adding pose: 216
Adding pose: 217
Adding pose: 218
Adding pose: 219
Adding pose: 220
Adding pose: 221
Adding pose: 222
Adding pose: 223
Adding pose: 224
Adding pose: 225
Adding pose: 226
Adding pose: 227
Adding pose: 228
Adding pose: 229
Adding pose: 230
Adding pose: 231
Adding pose: 232
Adding pose: 233
Adding pose: 234
Adding pose: 235
Adding pose: 236
Adding pose: 237
Adding pose: 238
Adding pose: 239
Adding pose: 240
Adding pose: 241
Adding pose: 242
Adding pose: 243
Adding pose: 244
Adding pose: 245
Adding pose: 246
Adding pose: 247
Adding pose: 248
Adding pose: 249
Adding pose: 250
Adding pose: 251
Adding pose: 252
Adding pose: 253
Adding pose: 254
Adding pose: 255
Adding pose: 256
Adding pose: 257
Adding pose: 258
Adding pose: 259
Adding pose: 260
Adding pose: 261
Adding pose: 262
Adding pose: 263
Adding pose: 264
Adding pose: 265
Adding pose: 266
Adding pose: 267
Adding pose: 268
Adding pose: 269
Adding pose: 270
Adding pose: 271
Adding pose: 272
Adding pose: 273
Adding pose: 274
Adding pose: 275
Adding pose: 276
Adding pose: 277
Adding pose: 278
Adding pose: 279
Adding pose: 280
Adding pose: 281
Adding pose: 282
Adding pose: 283
Adding pose: 284
Adding pose: 285
Adding pose: 286
Adding pose: 287
Adding pose: 288
Adding pose: 289
Adding pose: 290
Adding pose: 291
Adding pose: 292
Adding pose: 293
Adding pose: 294
Adding pose: 295
Adding pose: 296
Adding pose: 297
Adding pose: 298
Adding pose: 299
Exporting to FBX binary (.fbx)

FBX export starting... '/home/jack/Documents/ROMP/src/../demo/videos/sample_video2.fbx'
FBX export prepare: Wrapping Objects...
Done (0.000108 sec)

FBX export prepare: Wrapping Data (lamps, cameras, empties)...
Done (0.000023 sec)

FBX export prepare: Wrapping Meshes...
(bpy.data.armatures['Armature'], 'POSE')
Done (0.059239 sec)

FBX export prepare: Wrapping ShapeKeys...
Done (3.887468 sec)

FBX export prepare: Wrapping Armatures...
Done (0.000581 sec)

FBX export prepare: Wrapping World...
Done (0.000066 sec)

FBX export prepare: Wrapping Materials...
Done (0.000051 sec)

FBX export prepare: Wrapping Textures...
Done (0.000132 sec)

FBX export prepare: Wrapping Animations...
Done (26.115274 sec)

FBX export prepare: Generating templates...
Done (0.005133 sec)

FBX export prepare: Generating Connections...
Done (0.004316 sec)

FBX export fetch empties (1)...
Done (0.000068 sec)

FBX export fetch lamps (0)...
Done (0.000017 sec)

FBX export fetch cameras (0)...
Done (0.000014 sec)

FBX export fetch meshes (1)...
Done (2.476246 sec)

FBX export fetch objects (27)...
Done (0.001938 sec)

FBX export fetch remaining...
Done (0.026530 sec)

FBX export fetch animations...
Done (0.047706 sec)

export finished in 32.8456 sec.

Animation export finished.
Poses processed: 301
Processing time : 19.805374708026648

Exception ignored in: <function CyclesRender.del at 0x7f7d3e0a89e0>
Traceback (most recent call last):
File "/home/jack/anaconda3/envs/romp/lib/python3.7/site-packages/2.91/scripts/addons/cycles/init.py", line 67, in del
TypeError: 'NoneType' object is not callable

@NoLookDefense
Copy link
Author

NoLookDefense commented May 7, 2021

But the .fpx file is exported successfully. I don't know if this error matters, because the animation in blender seems strange...
The person is facing to the ground, and his arms seem horrible due to the strangle traingle.

Screenshot 2021-05-07 at 19 00 44

@Arthur151
Copy link
Owner

Arthur151 commented May 7, 2021

I am really happy that you finally made it.
It seems that you are unfamiliar with the Blender...
You can rotate the view by pressing the Middle mouse button and moving..
The 'strange triangle' you mentioned is his bone. You can choose to hide it through manipulating the scene collection (at the top right).

@NoLookDefense
Copy link
Author

Thanks for your help! It runs!

@NoLookDefense
Copy link
Author

I am really happy that you finally made it.
It seems that you are unfamiliar with the Blender...
You can rotate the view by pressing the Middle mouse button and moving..
The 'strange triangle' you mentioned is his bone. You can choose to hide it through manipulating the scene collection (at the top right).

BTW, there is another problem I want to mention. Will the .fbx model compatible with Unity?

@Arthur151
Copy link
Owner

Here is a portable way: export the Blender fbx model to fbx compatible with Unity.
Here is a video which introduce this simple action.
https://www.youtube.com/watch?v=ysl0qYq5p9w

Or here is a tutorial with more detail settings:
https://gamedevacademy.org/how-to-import-blender-models-into-unity-your-one-stop-guide/

Have a nice day.

@NoLookDefense
Copy link
Author

Thanks for you help. Wish you all the best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants