I made it that Rhino is obviously rendering all images choosen from an
animated slider connected to the component. It shows me "Image
successfully saved as D:\GH_Animation\frame"4".jpg" in the command
line but the destination folder remains empty!
From the code it looks like your slider should be attached to a
variable named "y" and the output to your destination folder (on your
D:\ drive in a folder named GH_Animation) should be a .bmp.
Is that what you have for a setup?
-taz
On May 6, 11:42 am, Patrick <pbed...@gmail.com> wrote:
> I made it that Rhino is obviously rendering all images choosen from an
> animated slider connected to the component. It shows me "Image
> successfully saved as D:\GH_Animation\frame"4".jpg" in the command
> line but the destination folder remains empty!
I tried different things: changing file types like png, jpg or bmp. (I
have to mention that I count myself completely to the script virgins)
I just inserted the code from Damien into a VB comp. If I connect an
object (i.e. geometry inside a bounding box) to the x input rhino
immediately starts to render an image. If I then connect a number
slider (which is also rotating the bbox geo) into the y input of the
VB comp it does the same thing again. For an animation from stills I
just need to animate the slider in a usual way and GH starts to
extract stills from slider positions and synchroniusly tells rhino to
render the scene in vray.
It all seems to work well but the destination folder remains empty!
> From the code it looks like your slider should be attached to a
> variable named "y" and the output to your destination folder (on your
> D:\ drive in a folder named GH_Animation) should be a .bmp.
> Is that what you have for a setup?
> -taz
> On May 6, 11:42 am, Patrick <pbed...@gmail.com> wrote:
> > He guys
> > for animation purposes I tried out a small VB script from Damien
> > Dim obj As IRhinoBrepObject = doc.AddBrepObject(x)
> > doc.Regen()
> > Dim filename As String = "D:\GH_Animation\frame" & Chr(34) & y &
> > Chr(34) & ".bmp"
> > I made it that Rhino is obviously rendering all images choosen from an
> > animated slider connected to the component. It shows me "Image
> > successfully saved as D:\GH_Animation\frame"4".jpg" in the command
> > line but the destination folder remains empty!
Make sure your folder name and file type are correct by manually
(inside Rhino interface) rendering and saving a frame using the same
steps set up in the code. (_Render, _SaveRenderWindowAs "D:
\GH_Animation\frame"4".bmp"). By doing this you can be sure that your
file type is also correct. In your original post it looked like your
script was trying to save a .bmp and the rhino output said it was
successfully saved as a .jpg which would leave your folder empty I
think. Hope that works otherwise the code might have to be altered a
little to save as a different filename without the quotes around the
frame number which some filetypes don't support.
On May 7, 10:53 am, Patrick <pbed...@gmail.com> wrote:
> I tried different things: changing file types like png, jpg or bmp. (I
> have to mention that I count myself completely to the script virgins)
> I just inserted the code from Damien into a VB comp. If I connect an
> object (i.e. geometry inside a bounding box) to the x input rhino
> immediately starts to render an image. If I then connect a number
> slider (which is also rotating the bbox geo) into the y input of the
> VB comp it does the same thing again. For an animation from stills I
> just need to animate the slider in a usual way and GH starts to
> extract stills from slider positions and synchroniusly tells rhino to
> render the scene in vray.
> It all seems to work well but the destination folder remains empty!
> > From the code it looks like your slider should be attached to a
> > variable named "y" and the output to your destination folder (on your
> > D:\ drive in a folder named GH_Animation) should be a .bmp.
> > Is that what you have for a setup?
> > -taz
> > On May 6, 11:42 am, Patrick <pbed...@gmail.com> wrote:
> > > He guys
> > > for animation purposes I tried out a small VB script from Damien
> > > Dim obj As IRhinoBrepObject = doc.AddBrepObject(x)
> > > doc.Regen()
> > > Dim filename As String = "D:\GH_Animation\frame" & Chr(34) & y &
> > > Chr(34) & ".bmp"
> > > I made it that Rhino is obviously rendering all images choosen from an
> > > animated slider connected to the component. It shows me "Image
> > > successfully saved as D:\GH_Animation\frame"4".jpg" in the command
> > > line but the destination folder remains empty!
Anyway, I played around with the script and I got it to work so here's
a couple things to note:
_The VB component updates with GH events (unless you disable the
setting under Solutions). Updating with GH events is what you want
when you are rendering out the animation (as the slider ticks along),
but before that any changes you make in GH will also cause a render to
occur.
_It may help you to set the x variable hint type to OnBrep as a
reminder. The script is only setup to render a single BRep object.
_Elizabeth was right. The extra double quotes in my .jpg file name
wont allow the file save. The double quotes symbol is represented by
the variable Chr(34) so removing them solves the problem. For
example:
Dim filename As String = "C:\GH_Animation\frame" & y & ".jpg"
-taz
On May 7, 5:53 am, Patrick <pbed...@gmail.com> wrote:
> I tried different things: changing file types like png, jpg or bmp. (I
> have to mention that I count myself completely to the script virgins)
> I just inserted the code from Damien into a VB comp. If I connect an
> object (i.e. geometry inside a bounding box) to the x input rhino
> immediately starts to render an image. If I then connect a number
> slider (which is also rotating the bbox geo) into the y input of the
> VB comp it does the same thing again. For an animation from stills I
> just need to animate the slider in a usual way and GH starts to
> extract stills from slider positions and synchroniusly tells rhino to
> render the scene in vray.
> It all seems to work well but the destination folder remains empty!
> > From the code it looks like your slider should be attached to a
> > variable named "y" and the output to your destination folder (on your
> > D:\ drive in a folder named GH_Animation) should be a .bmp.
> > Is that what you have for a setup?
> > -taz
> > On May 6, 11:42 am, Patrick <pbed...@gmail.com> wrote:
> > > He guys
> > > for animation purposes I tried out a small VB script from Damien
> > > Dim obj As IRhinoBrepObject = doc.AddBrepObject(x)
> > > doc.Regen()
> > > Dim filename As String = "D:\GH_Animation\frame" & Chr(34) & y &
> > > Chr(34) & ".bmp"
> > > I made it that Rhino is obviously rendering all images choosen from an
> > > animated slider connected to the component. It shows me "Image
> > > successfully saved as D:\GH_Animation\frame"4".jpg" in the command
> > > line but the destination folder remains empty!
The double quotes symbol is represented by
the variable Chr(34) so removing them solves the problem. For
example:
Dim filename As String = "C:\GH_Animation\frame" & y & ".jpg"
You are a genius taz! Thanks a lot man thats great. But for
understanding the problem can you explain about theese double quotes?
I'm hardly getting behind this scripting chinese until I forced myself
to learn the vocabs.
> Anyway, I played around with the script and I got it to work so here's
> a couple things to note:
> _The VB component updates with GH events (unless you disable the
> setting under Solutions). Updating with GH events is what you want
> when you are rendering out the animation (as the slider ticks along),
> but before that any changes you make in GH will also cause a render to
> occur.
> _It may help you to set the x variable hint type to OnBrep as a
> reminder. The script is only setup to render a single BRep object.
> _Elizabeth was right. The extra double quotes in my .jpg file name
> wont allow the file save. The double quotes symbol is represented by
> the variable Chr(34) so removing them solves the problem. For
> example:
> Dim filename As String = "C:\GH_Animation\frame" & y & ".jpg"
> -taz
> On May 7, 5:53 am, Patrick <pbed...@gmail.com> wrote:
> > taz,
> > I tried different things: changing file types like png, jpg or bmp. (I
> > have to mention that I count myself completely to the script virgins)
> > I just inserted the code from Damien into a VB comp. If I connect an
> > object (i.e. geometry inside a bounding box) to the x input rhino
> > immediately starts to render an image. If I then connect a number
> > slider (which is also rotating the bbox geo) into the y input of the
> > VB comp it does the same thing again. For an animation from stills I
> > just need to animate the slider in a usual way and GH starts to
> > extract stills from slider positions and synchroniusly tells rhino to
> > render the scene in vray.
> > It all seems to work well but the destination folder remains empty!
> > On 7 Mai, 09:23, taz <tzez...@gmail.com> wrote:
> > > Patrick,
> > > From the code it looks like your slider should be attached to a
> > > variable named "y" and the output to your destination folder (on your
> > > D:\ drive in a folder named GH_Animation) should be a .bmp.
> > > Is that what you have for a setup?
> > > -taz
> > > On May 6, 11:42 am, Patrick <pbed...@gmail.com> wrote:
> > > > He guys
> > > > for animation purposes I tried out a small VB script from Damien
> > > > Dim obj As IRhinoBrepObject = doc.AddBrepObject(x)
> > > > doc.Regen()
> > > > Dim filename As String = "D:\GH_Animation\frame" & Chr(34) & y &
> > > > Chr(34) & ".bmp"
> > > > I made it that Rhino is obviously rendering all images choosen from an
> > > > animated slider connected to the component. It shows me "Image
> > > > successfully saved as D:\GH_Animation\frame"4".jpg" in the command
> > > > line but the destination folder remains empty!
The problem with the double quotes which might need explanation is two
fold:
First, like I said before, some (and most on PCs) files don't support
quotation marks, or other random characters in their file names such
as /, *, ", etc... Another similar programming phenomenon is a space.
Take for example when you go to a web page or image that has spaces in
the file name, these spaces are replaced by an ampersand (&) or a plus
sign (+) in order for the browser to read your file.
Second, ASCII characters (which is what the "Char(34)" referred to)
are from the American Standard Code for Information Interchange.
Basically, each character has an ASCII value assigned to it which you
can refer to in most programming languages and the computer will
understand it as the character it's referencing (built in variable
definitions if you will). When we're trying to print something such
as a file name, in order to use symbols which the programming language
uses to differentiate other things such as comments, we can use the
ASCII value so that it doesn't get confused as to what we're trying to
output. You can look up the ASCII table online and see that the
printable characters start at 32 and work their way up, the quotation
happens to be the second on the list giving it the ASCII character
code 34.
Hope this helps with some of your scripting questions!
On May 8, 9:02 am, Patrick <pbed...@gmail.com> wrote:
> The double quotes symbol is represented by
> the variable Chr(34) so removing them solves the problem. For
> example:
> Dim filename As String = "C:\GH_Animation\frame" & y & ".jpg"
> You are a genius taz! Thanks a lot man thats great. But for
> understanding the problem can you explain about theese double quotes?
> I'm hardly getting behind this scripting chinese until I forced myself
> to learn the vocabs.
> > Anyway, I played around with the script and I got it to work so here's
> > a couple things to note:
> > _The VB component updates with GH events (unless you disable the
> > setting under Solutions). Updating with GH events is what you want
> > when you are rendering out the animation (as the slider ticks along),
> > but before that any changes you make in GH will also cause a render to
> > occur.
> > _It may help you to set the x variable hint type to OnBrep as a
> > reminder. The script is only setup to render a single BRep object.
> > _Elizabeth was right. The extra double quotes in my .jpg file name
> > wont allow the file save. The double quotes symbol is represented by
> > the variable Chr(34) so removing them solves the problem. For
> > example:
> > Dim filename As String = "C:\GH_Animation\frame" & y & ".jpg"
> > -taz
> > On May 7, 5:53 am, Patrick <pbed...@gmail.com> wrote:
> > > taz,
> > > I tried different things: changing file types like png, jpg or bmp. (I
> > > have to mention that I count myself completely to the script virgins)
> > > I just inserted the code from Damien into a VB comp. If I connect an
> > > object (i.e. geometry inside a bounding box) to the x input rhino
> > > immediately starts to render an image. If I then connect a number
> > > slider (which is also rotating the bbox geo) into the y input of the
> > > VB comp it does the same thing again. For an animation from stills I
> > > just need to animate the slider in a usual way and GH starts to
> > > extract stills from slider positions and synchroniusly tells rhino to
> > > render the scene in vray.
> > > It all seems to work well but the destination folder remains empty!
> > > On 7 Mai, 09:23, taz <tzez...@gmail.com> wrote:
> > > > Patrick,
> > > > From the code it looks like your slider should be attached to a
> > > > variable named "y" and the output to your destination folder (on your
> > > > D:\ drive in a folder named GH_Animation) should be a .bmp.
> > > > Is that what you have for a setup?
> > > > -taz
> > > > On May 6, 11:42 am, Patrick <pbed...@gmail.com> wrote:
> > > > > He guys
> > > > > for animation purposes I tried out a small VB script from Damien
> > > > > Dim obj As IRhinoBrepObject = doc.AddBrepObject(x)
> > > > > doc.Regen()
> > > > > Dim filename As String = "D:\GH_Animation\frame" & Chr(34) & y &
> > > > > Chr(34) & ".bmp"
> > > > > I made it that Rhino is obviously rendering all images choosen from an
> > > > > animated slider connected to the component. It shows me "Image
> > > > > successfully saved as D:\GH_Animation\frame"4".jpg" in the command
> > > > > line but the destination folder remains empty!
Im just a begineer of gh and know nothing about vb, but I really want
to render the animation of something that I learned, could you hang
the componets or the defination on the froum for me to learn how to do
it ? :)
Basically the idea is in there to rotate an object referenced as geo
and render this animation. All you have to do is to animate the slider
in a usual way (right click etc.. here it works with 125 frames, so
maybe you have to adjust the slider and the function comp in order to
get the right frame titles and amound of rotation desired)
The reason why I used this circular slider / function combo is because
I wanted to rotate the geometry and synchronously give a sense making
name to the frames created. I am pretty sure there is better way in
doin this. Is there?
Cheers, pat
On 8 Mai, 14:15, Taylor <delete2...@gmail.com> wrote:
> Im just a begineer of gh and know nothing about vb, but I really want
> to render the animation of something that I learned, could you hang
> the componets or the defination on the froum for me to learn how to do
> it ? :)
Truely thanx Pat, thank you for your explaination too, but seems my
computer has something wrong, when I was opening the gh file contains
vb, the gh would waring me someting wrong in xml line 34...then
nothing happened...
Big up again for you guys we already tried this comp out - a little
squared cookie for you: http://www.a-ngine.com/
@Taylor: don't know really. Make sure and go through the posts above
that you did no mistake in mixing up file type endings. Another thing
is that Vista didn't allowed me saving images on a folder placed on my
desktop. Go and check the code on the link above I posted a screenshot
with code editor on my blog
On 8 Mai, 18:35, Taylor <delete2...@gmail.com> wrote:
> Truely thanx Pat, thank you for your explaination too, but seems my
> computer has something wrong, when I was opening the gh file contains
> vb, the gh would waring me someting wrong in xml line 34...then
> nothing happened...
I loaded up the script because I was curious about this thing, and I'm
getting nothing. I changed the path to something appropriate for my
system. Tried with a cube, with a brep, etc. Still nothing. No
render window, no VB error messages. Any ideas?
Marc
On May 8, 8:34 pm, Patrick <pbed...@gmail.com> wrote:
> Big up again for you guys we already tried this comp out - a little
> squared cookie for you:http://www.a-ngine.com/
> @Taylor: don't know really. Make sure and go through the posts above
> that you did no mistake in mixing up file type endings. Another thing
> is that Vista didn't allowed me saving images on a folder placed on my
> desktop. Go and check the code on the link above I posted a screenshot
> with code editor on my blog
> On 8 Mai, 18:35, Taylor <delete2...@gmail.com> wrote:
> > Truely thanx Pat, thank you for your explaination too, but seems my
> > computer has something wrong, when I was opening the gh file contains
> > vb, the gh would waring me someting wrong in xml line 34...then
> > nothing happened...
Pat, I appriciate for your help, I still cannt open the defination, it
is a good way to rewrite a vb component as what you pasted in your
blog in my gh, I will have a try, thx again, by the way , the
rendering is cool!
Hi...Pat, I am back~, I have tried to rewrite a vb component , all
the same with your picture, my vb was red after I closed the
ScriptEditor.:( Then I found that the Gray line above our code, yours
is Geometry As Object, slider as object, however, my is x and y , I
cannot change it, what should I do?
Okay I think I got the thing: input parameters for the comp are
declared to be Geometry and Slider (right click and just rename the
first line) but inside the code they were named as x and y. Change it
like everything you want but make sure theese pairs are fitting. I
placed the changed definition here - tested and working for sure
http://groups.google.com/group/grasshopper3d/web/090509%20RenderANI.ghx
Let me know, pat
On 9 Mai, 06:31, Taylor <delete2...@gmail.com> wrote:
> Hi...Pat, I am back~, I have tried to rewrite a vb component , all
> the same with your picture, my vb was red after I closed the
> ScriptEditor.:( Then I found that the Gray line above our code, yours
> is Geometry As Object, slider as object, however, my is x and y , I
> cannot change it, what should I do?
sorry, I cannot open the file.... By the way, I render the slider
animation with simple way but Photoshop cannot open the bmp picture!!!
Why? Only movie maker could edit them...
> sorry, I cannot open the file.... By the way, I render the slider
> animation with simple way but Photoshop cannot open the bmp picture!!!
> Why? Only movie maker could edit them...
I've been pretty busy the last two days, so sorry for the delay in
posting (we had a user meeting up here and yesterday Brian James and I
were going back and forth on a number of things). Anyway, that code
should have more or less been what David sent to me a while ago. I'm
not sure exactly where you got it, but would imagine that it should
have been working from where ever it was copy/pasted from (me for the
original definition or another definition that was posted somewhere).
Anyway, the issue (which it seams most of you guys have found out) is
that the file name itself is getting a little messed up because of the
double quotes (the Chr(34) thing) that are being put in.
The double quotes at the begining and end (the ones in the
SaveRenderWindowAs macro) are fine and necessary for any file with
spaces. The double quotes in the filename are NOT okay, and it looks
extremely odd to me that they are their. First off, double quotes are
invalid character names, so windows will not allow that file to be
saved at all. Secondly, provided there was a space in the filename
(which in this case there isn't, but..) the double quote in the
middle will cause Rhino to think that the path is done being specified
and it will try to save it even though it may not have the full file
name with the extension.
So take the Chr(34) statements in the filename out and everything
should be fine. Again, sorry for the delay, and I think everyone got
to the heart of it without me.
Best,
Damien
On May 6, 11:42 am, Patrick <pbed...@gmail.com> wrote:
> I made it that Rhino is obviously rendering all images choosen from an
> animated slider connected to the component. It shows me "Image
> successfully saved as D:\GH_Animation\frame"4".jpg" in the command
> line but the destination folder remains empty!
Hi Damien, Could you do me a favor? Hang a right defination there
please..I still cannot open the file...and dont know how to change the
x,or y to other things.(right click doesnt work)...I swear I will
learn the vb after this project...but now...could you?
> Hi Damien, Could you do me a favor? Hang a right defination there
> please..I still cannot open the file...and dont know how to change the
> x,or y to other things.(right click doesnt work)...I swear I will
> learn the vb after this project...but now...could you?
I'm not sure why you need me to make a file for you. Just copy and
past the code that's above into a VB.Net component, remove the Chr(34)
in the filename line, and set the x input type to OnBrep. That's all
I'm going to do really, and if you can't get the file to open then
chances are something else is going on any way, so....
Best,
Damien
On May 9, 12:05 pm, Taylor <delete2...@gmail.com> wrote:
> Hi Damien, Could you do me a favor? Hang a right defination there
> please..I still cannot open the file...and dont know how to change the
> x,or y to other things.(right click doesnt work)...I swear I will
> learn the vb after this project...but now...could you?