Couple of Python Dev Q's for the masters
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/10/2012 at 13:55, xxxxxxxx wrote:
Q1: I am wanting a GUI element to only exist while a user is modifying a very specific parameter. This element is used as a temp guide while adjusting, then it should go away. So, in the Message method, I read of a CHECKUPDATE which is great so far. However unlike COMMAND data (button), the DATA argument passes None instead of telling me what parameter is being called. Like with a button it tells you which button is being hit so you can do something with it.
So at this point, I know when a user is modifying ANY parameter but not WHICH parameter. Any ideas how to get to the point I can know when a parameter is being modified AND which one it is? I can check the last cycle for a change in value of course, but then when it settles, the result would be False even if the user still keeps the mouse_button down.
Q2: I have on screen GUI displays that should be like a HUD and overlay whatever is going on in the eidt view. Meaning my elements should have no 3D values what-so-ever in the viewport, only float on top in strictly 2D space. I've built my widgets with various draw parameters being called in the Draw pass. However, my elements disappear behind objects in the scene as the camera moves around the world. I've messed with the Z space stuff quite a bit and set depth and all that and nothing seems to make a difference. It looks like in the C++ SDK I can use SceneHook, but that doesn't appear to be implemented in Python. Any advice as how to get my GUI stuff to live on the very "surface" of the viewport and always show despite what is going on in the scene?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/10/2012 at 16:41, xxxxxxxx wrote:
Hi Chris.
Q1
Not something I can offer much help on.
I use C++ with descriptions for this kind of plugin.Q2
This one I've had lots of experience with in both C++ and Python. Very annoying, and nobody knew how to solve it.
It turns out that there is an OpenGL bug, limitation, feature, whatever Maxon wants to call it.
For many people (including me) their graphics cards don't work properly with the Draw2D() functions.
But I discovered a work around for dealing with that problem. By adding a dummy 2D object to the top of my Draw() method.bd.SetPen(c4d.Vector(1.0, 1.0, 1.0)) bd.SetMatrix_Screen() #Use the screen's matrix to draw on bd.DrawLine2D(c4d.Vector(0, 0, 0), c4d.Vector(0, 0, 0)) #Draw a line with a zero length<---Dummy object bd.SetDepth(True) #This fixes drawing problems when using 2D
I use this trick a lot.
Here's some examples in both C++ and Python that use this trick if you want to see the code inside of working examples:https://sites.google.com/site/scottayersmedia/plugins-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/10/2012 at 17:49, xxxxxxxx wrote:
Thank you quite a ton(ne) for that , Scott. I'm using descriptions as well, just Python.
I will try your dummy object thusly.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/10/2012 at 22:46, xxxxxxxx wrote:
Scott, you are a genius. Worked like a charm. Suddenly all my Draw 2D elements jumped to the FG. Fantastic.
ONLY weirdness is if the cam is in the process of going through an object, it "shuts off". Is that just something I have to live with or any other settings you recommend?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/10/2012 at 08:15, xxxxxxxx wrote:
I'm not surprised you found a quirk in it.
It's just a trick I discovered after nobody could figure out the problem.
There are a few video cards that work just fine. And don't need my work-around trick. But I found out by taking a poll at CGTalk that most video cards have problems with the drawing functions.As for being a "genius". You're half right. My title is actually "Evil_Genius".
And with Halloween coming up on Wednesday. It's my busiest time of the year. !LOL
[URL-REMOVED]-ScottA
[URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.