Comments (9)
This is a fork from https://bitbucket.org/Coin3D/pivy/src. This fork only tries to add python3 compatibility. I haven't got a working soqt version, so I can't test this example right now. I will try to translate this example to quarter in the next days.
from pivy.
Thank you for your reply. Hope everything gose well.
from pivy.
https://github.com/looooo/pivy/blob/master/examples/Mentor_quarter/10.1.addEventCB.py
this works for me.
Is the pivy from the ppa based on this fork? I think all freecad-ppa use the official pivy repository, but maybe I am wrong.
ps.: Didn't try the arrow up... So the crash also appears with quarter.
from pivy.
I don't know the ppa well. I download the official coin source and cannot compile. And I install FreeCAD and find it contains pivy. Then I find your pivy project here. So If I want to install your pivy lib, do I just need to run the setup.py?
I alo test some mentor examples. Some of them will show warning messages (like 02.1), and some fails (like 10.3 and 10.6). I don't know if it is a bug of something else.
from pivy.
Thanks for your feedback,
If I want to install your pivy lib, do I just need to run the setup.py?
exactly:
To compile pivy run
python setup.py build
To install:
python setup.py install
But the problems will remain...
The problem with 10.1 is the scaling function. setting the scalefactror crashes the programm. I haven't investigated this, because with my branch I have found a strange problem with the callbacks...
FreeCAD has implemented it's own viewer. So I never had a look at the viewers provided by pivy (quarter, sogui). Maybe you can try to run the example within FreeCAD. Allthough the scaling problem will also remain.
from pivy.
finally I have found what caused the problem with my pivy version.
Here is the bt for the scaling problem:
#0 0x00007ffff7826418 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007ffff782801a in __GI_abort () at abort.c:89
#2 0x00007ffff786872a in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7ffff79816b0 "*** Error in `%s': %s: 0x%s ***\n")
at ../sysdeps/posix/libc_fatal.c:175
#3 0x00007ffff7870f4a in malloc_printerr (ar_ptr=, ptr=, str=0x7ffff797e48f "free(): invalid pointer",
action=3) at malloc.c:5007
#4 _int_free (av=, p=, have_lock=0) at malloc.c:3868
#5 0x00007ffff7874abc in __GI___libc_free (mem=) at malloc.c:2969
#6 0x00007fffeea05a04 in _wrap_delete_SbVec3f (args=) at pivy/coin_wrap.cpp:49974
#7 0x00000000004b0de3 in PyObject_Call ()
#8 0x00000000004b9362 in PyObject_CallFunctionObjArgs ()
#9 0x00007fffee76dd00 in SwigPyObject_dealloc (v=0x7fffef42aba0) at pivy/coin_wrap.cpp:1721
#10 0x00000000004fd546 in ?? ()
#11 0x00000000004d8d07 in ?? ()
#12 0x00000000004c9970 in PyEval_EvalFrameEx ()
#13 0x00000000004c22e5 in PyEval_EvalCodeEx ()
#14 0x00000000004de7fe in ?? ()
#15 0x00000000004b0de3 in PyObject_Call ()
#16 0x00000000004ce140 in PyEval_CallObjectWithKeywords ()
#17 0x00007fffee7d78b8 in SoEventPythonCallBack (userdata=0x7fffefdb37a0, node=) at pivy/coin_wrap.cpp:6898
from pivy.
- The error is somewhere in the
__imul__
(*=) function of SfVec3f... I will have a look at this, but simply using a = a * b instead of a *= b should also work. See here: examples/Mentor/10.1.addEventCB.py#L68 - Another thing not working in this example is this examples/Mentor/10.1.addEventCB.py#L184.
With quarter I added a callback function to redraw the scene when the selection changed: examples/Mentor_quarter/10.1.addEventCB.py#L193 With my pivy branch callbacks have to be set to a variable in python. This way it's possible to delete a callback. This is done similarly in FreeCAD. The problem with my implementation is that the return value of[done]addEventCallback(foo)
has to be set to a variable in python. Otherwise the garbage collector will delete this object and the callback can't access the function. examples/Mentor_quarter/10.1.addEventCB.py#L119
from pivy.
Hi, I am still reading your code. If I have any though, I will tell you. Thank you.
from pivy.
I think this should be fixed
from pivy.
Related Issues (20)
- SoGui.init(sys.argv[0]) run error HOT 6
- 'pivy._coin' has no attribute 'delete_SoGeo' HOT 7
- circular import error HOT 16
- Possible to SegFault SoPerspectiveCamera.getMatrix
- Pivy fails to build with Python 3.12 HOT 4
- Pivy failes to build with Python 3.13 HOT 4
- ImportError: cannot import name 'QActionGroup' from 'pivy.qt.QtWidgets' HOT 5
- imp module is removed in Python 3.12 HOT 2
- LINK : fatal error LNK1104: 无法打开文件“"G:\coin\coin\VS\Coin\lib\Coin4d.lib"”
- move to github actions and build for multiple python versions
- Transfer ownership of PyPi entry HOT 2
- How do you recommend projects find pivy using CMake ? (Is there a Findpivy.cmake?) HOT 4
- Recursion in SoBaseKit.__getattr__ HOT 4
- Pivy Python 3.10/3.11 compatibility? HOT 16
- unable to open file "...\Coin3D\lib\Coin4.lib" HOT 1
- Neither setup.py nor CMake build works without issues
- Could not find a package configuration file provided by "Coin" HOT 4
- macos build failure using cmake HOT 20
- SoVMRLTransform.setMatrix doesn't accept a parameter
- FreeCAD fails SIGSEGV, some pivy tests/ FAIL, one fails with SIGSEGV HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pivy.