Using one-line python scripts with IPO drivers connected to shape keys, transparent UV maps, and the new outliner that can lock objects from being selected, I am trying to make a lamp shade for area lights that show off the properties of the lamp in a visual form…
Here’s some code I’ve made (that doesn’t work) that I’m just executing with alt-P to try and “see” a regular lamp object that I’ve named riglight
from Blender import Lamp
print( dir(Lamp.riglight))
And here’s an example of what I’m trying to get as a finished product. I’d like to mimic Brazil’s GUI for area lights as closely as possible. This is a great first step for me who has never touched the CVS. I know a little bit of python. Thanks to anyone that can provide me with some help.
BCam:
BLight:
I would also like to ask if anyone has made shape-key scripts that read properties of objects before? and if so, do they react in realtime or does the user have to wait for the value to be input? If the latter, then I have no problem adding handles to a light.
I’ve done some testing in python with the BGL module (the way to access the opengl of the 3Dview, via python) and I think it’s safe to say that’s not the way to go. Have a look at this .blend file for an example.
It visualises the lamp color, energy and distance
directly in the 3D view, using python to access the
opengl part of 3D view.
In my opinion we can conclude that this is not the way
to go, as it’s way too slow. The shape of the lamp casting
area can for example not be refined much more or it’ll crash
blender (just change the 1 in line 26 to 2) to see what I
mean.
The solution to only display information of the selected lamp
(uncomment line 8) isn’t working either. Just try to select
two lamps and you’ll see the problem.
So if you wish to use python to visualise extra information,
the BGL module isn’t the way to go. With the possible
exception of displaying only little information is in for
example Mariano Hidalgo’s lamp widget script: http://uselessdreamer.byethost32.com/lamp_widgets.html
Crouch.
So in my opinion the best options would be to implement it natively in blender, coding it in C. Or to use python to create meshes that show the lighting information. The downside of this last option is that the meshes can get in the way while you’re working in blender.
Crouch, thanks for the link. I realize that code like this has shown up in test builds on graphicall as part of the source - powered by C instead of python. I know that what I’m doing is stupidly slow. I’m not trying to build a permanent solution with python, I just want someone out there with coding expertise to notice what I want as a feature. The best way I can see for better visualization for lights to get into Blender is for me to muck around with prototypes, and to do that, I’m using python since I know a little.
Edit: I made this with a test build of Blender that has the new Outliner stuff that lets the meshes for the lamp not be selectable (and therefore passive)
Can we agree that what I made at least looks better than a square with a line coming out of it? Of course it is more verbose, and it involves transparency which slows draw times, but the advantage is better knowledge of how your lights are affecting the scene.
Edit: the blend file you linked doesn’t work. And you even said it doesn’t. I’m sort of confused why you shared that information. I guess it’s helpful so I don’t run into that problem myself… >.>
The intention of my previous post was indeed to prevent you from running into that problem. Though I have to admit that I probably misunderstood what you wanted to reach.
I’ll have a go at transforming the .blend you provided in a working example. Just give me a few days, because i’m rather busy at the moment.
I havn’t forgotten about this project, but I admit to not being on this board very often. What do you intend on doing, Crouch? I realized quickly that my math wasn’t so good with the IPOs and things… If you want to make some sort of C++ version in a test build, let me at least try and help you. The mock-up isn’t quite what I wanted.
It won’t be a c(++) version. All I know is python.
But I’ll give you an example of what I intend to do tomorrow. (I haven’t forgotten about this either, just been very busy)
Edit: in your example the lightbeams and suzanne are transparent in the 3d-view, while the red rings aren’t. How did you do this?
Hey hi!!.. I think it’s a good start… but… maybe it would become a little annoying if you have many objects into the scene… think the scene with 10 or 15 lamps…mmmm
I was waiting for something like this…
I’m not a coder… so what I can say is just an opinion…
Maybe it could be a little diferent the way you visualise the lamps… cause like I’ve said before… having 20 lamps it colud be a mess… or maybe have the option to activate or deactivate the visualisation…
It’s kind of confusing in the actual blender when you have some object iluminated with 1 lamp, cause you really have to rotate the view many times around to be sure it is inside the area of the lamp…
Thanks for the feedback on the wip. What exactly do you have in mind with a different visualisation? Have you seen the pics at the start of this thread (4th post)?
Still to do:
find out how to display images with alpha in the 3D-window (bmud, care to enlighten me?)
add other types of lights
off switch for the visualisation
Discussion:
what features would you like to see bmud? Perhaps you can send me a pm with your vision.
visualisation of the lights. Won’t it get too much of a mess with 20 lights around?
This thread deserves to be bumped because I’m submitting the idea to Blenderstorm. I also just recently figured out a vast number of things over the past year or how ever long it’s been:
A: how to fake this a lot better to show you all what i’m trying to get
and B: how to program 3D graphics in openGL, which I think is probably the more useful skill.