Grasshopper

algorithmic modeling for Rhino

Hi, 

This was working the other day, but now it is not which makes me suspicious of the code. 

I am using firefly's webcam as an input and python to create a .bmp snapshot. 

I am only doing this because Firefly does not offer a way to send a boolean value to their 'snapshot' component to create an automated snapshot. Thus I send a boolean from python to the 'snapshot' component and it should work...

here is the code and attached definition. Thank you in advance. 

if Capture == True:
#extract an image
image = bmp.CopyPixelsTo(image)

#output image
snapshot = image

Views: 684

Attachments:

Replies to This Discussion

Hi johnnyUtah05,

maybe you could use a "Data Dam" (it's a special param), that way nothing will flow downstream and the FireFly component will not run until necessary?

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi Erik,
you could use the Firefly SnapshotSequense component by setting the number of snapshots to record (input N) to 1. (Note: this will leave a "_0" suffix on the filenames).

Only thing is that you'll have to come up with a way to name the files sequentially.

Attachments:

Thanks to both of you. 

@ Giulio - I was not aware of the component you recommended. Very interesting thank you. 

@ Peter - I had been trying to figure something out something similar to your solution with the Snapshot Sequence component, but hadn't gotten it working. Nice to see a proper solution.  This is very helpful. 

Thank you, Johnny

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service