Python Script and Capture Motion Failures Need Your Help
markchang2006 opened this issue · 10 comments
Thank you so much for your amazing job and detailed tutorial on Youtube!
I follow every steps carefully whilst unfortunately met some issues need your kind help if possible. Thanks very much in advance!
- The first issue is "Python script failed" when running OpenCVAnim.py, please find the attached jpg files for details.


There is no further error message when running OpenCVAnimOperator.py,
- The second issue occurred when the "capture" button is clicked, the screen shots are shown as the attached jpg files below:



One question: if I use the build-in webcam on my laptop, is the setting of "cv2" in the file "OpenCVAnimOperator.py" needs to be modified? {lease advise. Thanks!
I think it's better for you to figure the possible root causes out if the Vincent.blend file is attached here:
Vincent.zip
and the paths on my Laptop are listed below for your information:
D:\Blender_Practice\MotionCapture\GSOC2017-master
D:\Blender_Practice\MotionCapture\control-3d-character-using-python-master
Laptop System information:
Intel i7-8750H CPU@2.20GHz
32GB DRAM
Win-10 Ver.2004
Nvidia GTX 1050Ti
USB2.0 UVC WebCam (Build-in on laptop Screen)
Please feel free to let me know should you need any more information. Thanks so much for your talented help in advance!
Hi sir,
first i am vary happy to hear that and ill help you until you find the solution
-
Please set the full path of the model in the
OpenCVAnimOperator.pyLine40:
landmark_model_path = "D:\\Blender_Practice\\MotionCapture\\GSOC2017-master\\data\\lbfmodel.yaml" -
about the built-in webcam : per default i put the ID of the built in one but if you wan to use your second webcam you should change the ID in the line
210and change the0to1inself._cap = cv2.VideoCapture(0) -
Please Download the test.py file HERE this file only to check if the model and the webcam are working fine
put it in this pathD:\Blender_Practice\MotionCapture\control-3d-character-using-python-master
it will help you out to figure if the model and the webcam are working fine
[-] if there is a problem with thetest.pyfile please let me know
[+] if thetest.pyworks fine so you can just go to theOpenCVAnimOperator.pyand change the model path then also don't forget to check the cam id in the line210and change the0to1if you want to use you 2nd webcam
PLEASE DON'T HESITATE TO CONTACT ME IF YOU FACED ANY FURTHER PROBLEMS
Hi! Joe,
I'm so touched for your prompt response with so much details!
In response to the actions list above. I'm trying the best to report to you as detailed as possible, hopefully it will help more people who is interested whist suffered from similar issues :
-
The full path of the model in the OpenCVAnimOperator.py Line 40 has already been set as:
landmark_model_path = "D:\Blender_Practice\MotionCapture\GSOC2017-master\data\lbfmodel.yaml" so as to correspond to my file directory situation. -
I've tried to run script Test.py in Vincent.blend file twice:
The first time was run with self._cap = cv2.VideoCapture(0) in the line 210 of OpenCVAnimOperator.py
The error message on system console is shown below:

and here comes my question: is Visual Studio 2017 needed? mine is vs2019 currently.

The second time I ran Test.py in Vincent.blend file with self._cap = cv2.VideoCapture(1) in the line 210 of OpenCVAnimOperator.py
Then, the error message on system console is somehow different as shown below:
As both trial indicate warnings about c::\Project\opencv-python......, but actually I don't have such folder on my laptop, therefore, I have no idea what are the possible root causes.
-
I've downloaded the Test.py file and put in the path you instructed as shown in the zip file below for your information.
control-3d-character-using-python-master.zip -
The Test.py gets no problem when I change the "_cap.set(cv.CAP_PROP_FRAME_WIDTH, 640)" and
"_cap.set(cv.CAP_PROP_FRAME_HEIGHT, 480)" in the lines 8 & 9 respective from both original settings "512" and "512", and ran Test.py in Vincent.blend file with self._cap = cv2.VideoCapture(1) in the line 210 of OpenCVAnimOperator.py
So, my temporary thought is that the issues shown above is nothing to do with Visual Studio 2017.
- Currently the problem I have is, every time, when I open Vincent.blender file, it runs the Test.py first. It results in the issue that any action cannot be run further in the Vincent.blender file, except execution of Test.py. The only way I can stop Test.py is pressing [esc] key on keyboard, but it will close Vincent.blender file simultaneously. Please help when you're available, thanks a lot in advance!
Hi Joe,
Good news, it's solved.
I've redone the whole procedure again, the only differences are listed below for your information:
-
CMD with right click first and select the administrator option, then executed those 2 commands.
-
On Vincent.blender file, I ran OpenCVAnimOperator.py first instead of the other one.
I'm very appreciated with your prompt response and kind support. Thank you very much!
Hi mark
I am very happy to hear that you found the solution
Please mark the issue as solved
let me know if you have any future problems
Best regards
joe
Hi ,
yes you can do it
Hi sir,
Yes for sure, you can just look for record blender animation
https://bit.ly/2CqHbn2
Can You Please Set the Issue as Solved !
PLEASE DON'T HESITATE TO CONTACT ME IF YOU FACED ANY FURTHER PROBLEMS
python with joe support





