algorithmic modeling for Rhino
Just messing around with dynamically changing the light color from Grasshopper.
Tutorial: http://datable.net/modifying-rhino-object-attributes-from-gh/
Code: https://gist.github.com/4104781
Tags:
Comment
nice work Luis!
1+ for making this available in a plug in
Note, this has some implications on the UNDO stack...
This is the actual code...can be used for anything. I started using it with PointClouds to update them dynamically, but yes, it works with anything.
Rhino.DocObjects.ObjRef obj = new Rhino.DocObjects.ObjRef(id);
Rhino.DocObjects.LightObject lobj = obj.Object() as Rhino.DocObjects.LightObject;
lobj.LightGeometry.Diffuse = col;
lobj.LightGeometry.Intensity = pow;
lobj.CommitChanges();
And as Dhruv suggests, I would be interested to fold this direct-modification approach into some of the HDT tools. Would you be opposed to my shamelessly copying your brilliant technique?
WHOA! did not know you could use set one guid to get non-GH-Friendly objects. Awesome!!!
Try this code in a VB component:
Dim objref As New docobjects.ObjRef(x)
Dim l As Light = objref.Light
l.Diffuse = y
l.Intensity = z
doc.Lights.Modify(x, l)
Connect the ID to the x input, set it as Guid, connect a color to the y input and a slider to the z input (add a third input).
is there any chance to see this as a plugin or component?
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by
You need to be a member of Grasshopper to add comments!