Grasshopper

algorithmic modeling for Rhino

Hey, does anyone know a way that you can make a rectangular light parametric so that you can move it with objects in grasshopper and possibly control the light intensity?

Is there another plugin that is needed to accomplish this?  It seems like it should be simple to basically make a light move when an object moves.  Let me know!  Any help would be greatly appreciated.

Views: 4683

Replies to This Discussion

The Human plugin permits some control over lights - you can access the properties of existing light objects, create new lights (linear or point), with control over their properties. However, a technique akin to the one Luis used in this video: http://www.grasshopper3d.com/video/gh-point-light-interaction might be closer to what you want to do, if you want to modify an existing Rhino light and move it around. Here's a script mirroring his approach that lets you dynamically set the position and intensity of an existing light. To activate it, right click the "ID" parameter and choose "Set one Guid" - then select the light you want to modify. 

Attachments:

Andrew, 

So, I am trying to rotate the surface light.  I am able to get the surface light to move with the geometry that I want it to move with, by creating a relationship between the geometry I am moving and the light using an MD slider.  However, when I rotate the geometry, I am unable to rotate the surface light 360 degrees.  Is there a way to make the light rotate.  It seems like the problem is that the surface light is being read as a guid, which I am not completely familiar with.

Thanks!

Sean

Hi!

I need multiple SpotLights.

SetLight.gh works with one points, but it doesnt work with multiple points... How I can to fix it?

Andrew, 

So, I am trying to rotate the surface light.  I am able to get the surface light to move with the geometry that I want it to move with, by creating a relationship between the geometry I am moving and the light using an MD slider.  However, when I rotate the geometry, I am unable to rotate the surface light 360 degrees.  Is there a way to make the light rotate.  It seems like the problem is that the surface light is being read as a guid, which I am not completely familiar with.

Thanks!

Sean

The light is meant to be read in as a GUID - this is how the script gets access to the light object. 

The script I wrote initially is only interested in setting the location of a light - setting the position and orientation of a rectangular light is a bit more complex. The attached script uses a planar rectangular surface as input to specify the location, orientation, and dimension of an already-existing rectangular light in the scene. 

Attachments:

Andrew,

Thanks for the help!  So, when I create a surface, and then create a surface light, the location of the surface light when i set it does not set precisely to where the surface is located.  For some reason, the light is offset from the location of the surface, which makes it difficult to control the location in relation to an origin point.  Do you know what the problem might be?

it co

somehow that message got cut off funny :)

Sounds strange - but it could have something to do with where the light is defined to begin with. Try creating the light on the world XY plane before you reference its guid. If that doesn't work, can you upload your geometry? I can take a closer look. 

In case anyone's still interested in baking rectangular lights, here's one in python, which came from playing around with Andrew's file above.

The python version doesn't take a guid, but then doesn't allow you to control intensity.

It makes lights by taking rectangles as input, toggle true to bake.

I'm only using it to flood a ceiling with rectangular lights, so there wasn't a need to individually adjust light intensities, but I'm posting it here for the people who are looking for something similar (like I was).

Attachments:

this script is great, thanks!

Hey Andrew,

Thank you for the script. I am fairly new to grasshopper and when I select the light to set one guid for the "ID" parameter, the point light in rhino just disappeared. Do you know what I did wrong here?

Best,Ya

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service