VFXTalk.com Register | Blogs | Wiki | Facilities | RSS  
Home Forums The Pad News Gallery Reels Jobs Talent Members List Social Groups Search Today's Posts Mark Forums Read

Get your copy of Taskwise Today!
Use the form below to log on to your account. Dont have a account? Sign Up Now! its free and easy and you will be a part of the largest VFX Commnity on the Planet!


Go Back   VFXTalk.com > Scripts & Plugins > Shake Scripts/Macros
Reload this Page Shake scripting

Reply
 
Thread Tools Display Modes
Shake scripting
Old
  (#1)
DezFX is Offline
Registered User
 
DezFX's Avatar
 
Posts: 5
Join Date: Jan 2004
Location: The other side...
   
Shake scripting - June 18th, 2004, 05:16 PM

Hello all, I'm an Effects Animation Student at Gnomon and I just finished going through the Shake 3 Pro Training Series book by Marco Paolini and loved it. The part of special interest to me was the Appendix-A when he touched upon the Shake Scripting language with the custom Multipass node. I was wondering, is there any other books or training material I can get to expand on the Shake Scripting Language? I use Shake 2.5 at school so I don't have access to the manuals, because they are somewhere in the schools Tech Support system. LoL Anyhow, I would really LOVE to get my hands on any other source of training that is available. Any ideas?


Dez - Gnomon Student
[EMAIL=SpecialFX@verizon.net]Email Me[/EMAIL]

[url=http://www.dezfx.com][img]http://www.dezfx.com/Images/DezFX.jpg[/img][/url]
"...the only thing we have to decide is what to do with the time that we are given."
  
Reply With Quote
VFXTalk Sponsored Links
Old
  (#2)
Hugh is Offline
VFXTalk Admin
 
Hugh's Avatar
 
Posts: 3,093
Join Date: Jan 2003
Location: London, UK
   
June 19th, 2004, 03:54 AM

As far as I know, there are no specific resources just for Shake scripting...

However, there are 3 things that it is good to know when you write scripts...

How Shake nodes work: If you're going to be plugging them together in a macro, you need to understand what's going on and what parameters they are going to expect.

Basic C: There is a lot of basic C that can be used in a macro. Things like if and for statements for example. You can also get it to allow you to run standard C functions (system() is a popular one for running external commands, although more from UI elements than the internals of a node...)

Where to get reference: There are two .h files that define just about all of the functions that you can use. These are in your Shake directory/include and are called nreal.h and nrui.h. nreal.h has all of the functions to do with standard Shake working including maths functions and nodes (some of the nodes are defined as external but some are actually written as macros in this file). nrui.h has all of the UI functions in it - different ways you can define a paramater in your macro's UI.h, functions for adding items to a toolbox or menu


I'm sorry I haven't been able to help with what you are after, but if you've got any specific questions, do ask - I'm sure someone here can help you out...


Hugh Macdonald
nvizible
VFXTalk VIP   
Reply With Quote
Old
  (#3)
DezFX is Offline
Registered User
 
DezFX's Avatar
 
Posts: 5
Join Date: Jan 2004
Location: The other side...
   
June 20th, 2004, 12:19 AM

Thanks Hugh,

What I am mostly looking for is any ref material on the language that Shake uses when making macros and such. As I said I have the Shake 3 book that has a very brief overview of creating macros and I was wanting to expand on that. The cover DVD has two macro *.h files that you can open and look at in a text editor. One of the files only works with Shake 3 and the other was crapping out while trying to execute in Shake 2.5.1. I ended up reverse-engineering the script and building a macro that works by recreating the script from scratch. The "MultiPass.h" works for me now just fine. Anyway, while doing that it was quite interesting and I was just hoping to find more information on how scripting works within Shake.


Dez - Gnomon Student
[EMAIL=SpecialFX@verizon.net]Email Me[/EMAIL]

[url=http://www.dezfx.com][img]http://www.dezfx.com/Images/DezFX.jpg[/img][/url]
"...the only thing we have to decide is what to do with the time that we are given."
  
Reply With Quote
Old
  (#4)
Aruna is Offline
2d at d2
 
Aruna's Avatar
 
Posts: 2,286
Join Date: Feb 2003
Location: Venice, CA
   
October 21st, 2004, 01:49 PM

Well, I had this really nice explanation and quick tutorial about how I create my macros, but of course, mozilla crashes on me, and I lose it all!! So now I'm writing this in a text doc before I submit the post, so this will be complete.

I'm not sure how much more shake scripting you have tried since your last post, but here's how I create mine.. Macros are just bundled scripts, so you can cut and paste nodes from shake into a text document, and you'll see what the actual node is doing! For example, let's say we wanted to create a macro that blurs successively and uses one slider to control all of them. A quick way to do this is attach several blurs in a row in shake and hit Create Macro. How boring and simple. Let's do it the hard way.

By cutting and pasting a blur node into a text document, we find this:
Code:
Blur14 = Blur(0, 0, xPixels, 0, "gauss", xFilter, "rgba");

// User Interface settings

SetKey(
    "nodeView.Blur14.t", "0",
    "nodeView.Blur14.x", "2039.14282",
    "nodeView.Blur14.y", "537.5575"
);
We can get rid of the User Interface settings, since we won't need them:
Code:
Blur14 = Blur(0, 0, xPixels, 0, "gauss", xFilter, "rgba");
We'll set up our macro this way, which I'll call multiblur.h with its corresponding UI called multiblurUI.h.
Code:
image multiblur(
  image In=0
  )
{
Blur1 = Blur(In, 0, xPixels, 0, "gauss", xFilter, "rgba");
return Blur1;
}
As you can see I've replaced our Blur filein node with our image In and am returning our Blur1 result. We'll need to control our macro, so I'll put in a slider.
Code:
image multiblur(
  image In=0
  shift=0
  )
{
Blur1 = Blur(In, shift, xPixels, 0, "gauss", xFilter, "rgba");
return Blur1;
}
But how do we control our slider? We use our multiblurUI.h script!
Code:
nuiPushMenu("Tools");
    nuiPushToolBox("Filter");
        nuiToolBoxItem("@multiblur",multiblur());
    nuiPopToolBox();
nuiPopMenu();

nuiDefSlider("multiblur.shift",0,3000,0.1);
Our slider is set up to go from 0 to 3000, via 0.1 increments. But our shift control only controls one blur! We need it to control several! So I'll add a couple more blurs in our multiblur.h file.
Code:
image multiblur(
  image In=0
  shift=100
  )
{
Blur1 = Blur(In, shift, xPixels, 0, "gauss", xFilter, "rgba");
Blur2 = Blur(Blur1, shift*2, xPixels, 0, "gauss", xFilter, "rgba");
Blur3 = Blur(Blur2, shift*4, xPixels, 0, "gauss", xFilter, "rgba");
Blur4 = Blur(Blur3, shift*8, xPixels, 0, "gauss", xFilter, "rgba");
Blur5 = Blur(Blur4, shift*16, xPixels, 0, "gauss", xFilter, "rgba");
return Blur5;
}
Save both these files out to the respective locations so that they'll work with shake, usually /nreal/include/startup and /nreal/include/startup/ui/, and you should be good to go!
If you're still interested in more advance macro creation, I can always do a longer tutorial with other nodes and other commands.


aruna | nuke | digitalGypsy | VFXWages | twitter
VFXTalk VIP   
Reply With Quote
Old
  (#5)
Hugh is Offline
VFXTalk Admin
 
Hugh's Avatar
 
Posts: 3,093
Join Date: Jan 2003
Location: London, UK
   
October 21st, 2004, 02:42 PM

One very good resource of sample macros is your ${SHAKE_LOCATION}/include/nreal.h - this is where all of the core shake macros are defined (a lot of the nodes in shake are macros). I'm booted into Windows at the moment, so I can't give you any examples, but there's loads of stuff in there....

Also, nrui.h does all of the UI equivalent stuff for all of the nodes in Shake. It also defines all of the functions that you can use...


Hugh Macdonald
nvizible
VFXTalk VIP   
Reply With Quote
Old
  (#6)
DavidW is Offline
Compositor
 
DavidW's Avatar
 
Posts: 427
Join Date: Sep 2004
Location: Sydney, Australia
 Send a message via ICQ to DavidW Send a message via MSN to DavidW  
May 23rd, 2007, 06:27 PM

Highend2D/FXShare is a very good resource as well. Download some macros from the site and reverse engineer them to understand a lot of how they work and what the possibilities are:
http://www.fxshare.com/shake/


Technical Shake/Nuke compositor | Pixelmania | Me @ IMDB | Fluids for iPhone
VFXTalk VIP   
Reply With Quote
Old
  (#7)
gottony is Offline
use the "make awesome" button
 
Posts: 604
Join Date: Nov 2006
Location: Miami, Fl
  Send a message via MSN to gottony Send a message via Yahoo to gottony  
May 23rd, 2007, 08:22 PM

Great thread.
  
Reply With Quote
Old
  (#8)
ShakeandBake is Offline
Compositing TD
 
ShakeandBake's Avatar
 
Posts: 367
Join Date: Apr 2007
Location: 'Greater' LA area
   
August 21st, 2007, 12:18 PM

Gnomon has a DVD entitled 'Expressions Scripting and Macros which I found to be a good start.

And if your really serious (and got alot of money) there is the Apple Pro training series book on Shake SDK.

I also page through the user manual when I am stuck.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Get yo
ur copy Today!

Copyright © VFXTalk.com, 2009