Bret's Scripting Depo

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  10 October 2012
Bret's Scripting Depo

From time to time, I write scripts and release them on my website. But I do a piss poor job of telling people about them. So this thread will be a place I can post them all so all you guys can get a hold of them. Shameless plug, that if you use them, and find them extremely useful, consider donating a couple dollars to keep these little gems coming.

Store/Restore Phong Angle -Someone Iíve worked with in the past, was looking for a script to temporarily disable the phong tags in a scene. So I wrote a little script to do this. Simple to use. To use: You can either work with an object selected or have nothing selected. If you have some objects selected, then it will only work on those objectsí phong tag. If nothing is selected it will work on ALL phong tags. This stores the old value in a User Data on the phong tag. To restore the phong angles, hold SHIFT when you execute the script and it will restore back to the previous angle, and remove the user data.

Step Forward/Backward Selections-( script will take a selection you have on poly or spline objects, and then selects the next or previous points. So if you had Point #10 and #20 selected, the Forward Script will go and make your selection be #11 and #21. The Backward one would select #9 and #19.

Group Each-( Each is a helper script I made while I was rigging a car. ALT+G(or the Group Objects command) is incredibly helpful. If done on a single object you get a parent null at the same location as itís child. With multiple objects selected, it does the Average. Itís essentially the same as ALT+Clicking on a Null, but again, it doesnít work with multiple objects, and sometimes, I donít need it to do the average, I want each thing selected to get itís own parent null. Now it can. Select your objects, run the script, each will get a null parent with the same name with ď_algnĒ which is sort of my rigging suffix for a null that just rests at the same place as itís child.

Extrude 'Em All-( ĎEm All is a script aimed at those of you who work with a lot of splines. You probably have done the process of creating an ExtrudeNURBS, adding them all as children and turning on Hierarchical. Or Maybe you hit ALT+G to Group them into a null, then ALT+Clicked to create an ExtrudeNURBS as the parent(since it doesnít work with multiple objects afaik) and turned on Hierarchical. Well, This is a bit simpler. Select your splines, run the script. Boom, theyíre all a child of an ExtrudeNURBS with hierarchical turned on. Lowering the amount of time/clicks.

SoloSelected-( a nutshell, select your object(s) run the script. Boom, only those are visible. Run it again, everything is back to normal. If you hold CTRL and run the script, it will include any children of whatever you have selected. The other nice thing is that it should preserve all of your existing layers(see, internally, itís doing this magic through layers), so when you de-solo everything, your layers are back as they should be. No Muss, No Fuss. Well, maybe a little fuss. I think if you solo something that is being animated via a deformer, if the deformer isnít active, the animation wont be either. You donít lose your animation, itís just not capable of scrubbing your animation until you deSolo. I think that may be a limitation.

ASBake-( is a python port of a COFFEE Script that Adam Swaab wrote some time ago. Select objects you want to bake, Run the script, wait for the dialog. Bing Bang Boom. Don't thank me, thank Adam for it.

Create Null Joint-( stemmed from making some Finger setups. Often you need multiple joints in the same spot, some to control other rotation axes, etc. The process for this is you can CTRL+Drag to duplicate the joint, make it a child of the original joint, delete the duplicate children, and set it to null(so that it wont bind). Not terribly difficult, but annoying. This script will take whatever joints are selected, create null joints, and properly make them the parent joint, and all that jazz. Itís undoable too which is nice.

Great Job!-( Job stems from something written by Patrick Goski called P-Ray. It was a simple script that would give you motivational inspiration as you work. David Lewandowski, suggested it compliment some of your objects and or Material setups. So when you click it it will randomly compliment a random object or a random material. AND, if you donít have either in your scene, it will complement your ability to create a new scene!

HideUnhideSelection-( script stems from me having to work in Maya every day. In Maya, if you want to hide an object, you press CTRL+H. To Unhide, you press SHIFT+H. Extremely handy. But in C4D, you gotta either click the dots twice, or you gotta select it, go in the basic tab, blah blah blah. Itís just clunky, and now Im used to it(same thing with the solo selected script, its just a part of my workflow now). The key to this, and yes itís kind of stupid but whatever, The Hide Script needs to be a shortcut with CTRL and SHIFT(Because if you do CTRL+H on Mac it hides the app). Thatís how it looks for it. The Unhide portion needs to use just SHIFT. Thatís the kicker. Otherwise itíd need to be two separate scripts, which I mean it could but whatever.

ParentToLastSelected-( is another script based off of a workflow I have in Maya. To parent in Maya, you select objects, then the object you want to parent them under and press P. Simple right? To unparent, you press SHIFT+P. I didnít deal with the unparenting here, because SHIFT+G in C4D does it sort of(just doesnít unparent to the world which isnít too bad. But anyway, This script, assign it to a shortcut. Select objects you want to be a child, and then select what you want to parent them under LAST. Run the script and enjoy.

B3 Auto-Rigger-( is two scripts one to build an adjustment rig and then a final rig. It was written for R12, and is taken as is. R13 does this thing about 1000 times better. But, there's a lot of great code in there to reuse.

Most of these should work in R12-R14. Most of them were made in R13 I do believe. So yeah. If there issues let me know and I'll try to fix them.

"We do not - not wag our genitals at one another to make a point!"

Last edited by xfon5168 : 11 November 2012 at 09:06 PM. Reason: Added a new Script
  10 October 2012
nice one, thanks bret.
R17 studio |

>. our film is complete ! check it out here. . .
  10 October 2012
Pure awesomeness!! Life saviour for shorts!
  10 October 2012
Glad you guys like it. Hope to do more down the road when I have some more time. Plugins too. I got a fun one in the works.
"We do not - not wag our genitals at one another to make a point!"
  10 October 2012
Great scripts, Bret. Some real time savers in there, thanks!

My Reel
  11 November 2012
Added a new script to the top of the list to store/restore the phong angle of an object.

"We do not - not wag our genitals at one another to make a point!"
  11 November 2012
Great.. thanks....
I've posted this on the Lounge as well.

- link -

Retired Cinema4D Guru

  11 November 2012
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 02:51 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.