Jump to content



Forums, gallery and free tutorials dedicated to using and learning Cinema 4D. Sign up today and start enjoying what we have to offer. Registration is fast and free.

Pydeform Plugin V1.0 - New

Plugins Python

  • This topic is locked This topic is locked
5 replies to this topic

#1 MarcPearson

  • Regular Member
  • 23 posts
  • C4D Version:13 Studio
  • Location: Texas

Posted 02 February 2012 - 06:42 PM

PyDeform is a Cinema 4D Plugin I developed to increase your efficiency and speed up your workflow. The goal is to identify the tedious and repetitive tasks that take up your time...and automate them!
The aim is simple...the faster you work... the more time you have to create.

  • Five built-in deformers to choose from, with MUCH more on the way
  • Automatically positions and re-sizes the deformer so you dont have to!
  • Can save you up to 30 seconds every time you need a deformer!
Vimeo:
http://vimeo.com/36107845

My Site:
http://footprint-productions.com/products/pydeform-v10-plugin-for-cinema-4d

Hope you enjoy and comments/suggestions are always welcome!

-Marc

#2 zenpunk

  • Supporter's Club Bronze
  • 102 posts
  • C4D Version:13 Studio

Posted 02 February 2012 - 10:48 PM

good stuff... thanks.

My only comment/suggestion would be .. it would be cool if it could work in a slightly different way, too.  Personally, I'd like it to just be one "PyDeform" button I could add to my toolbar.  Then, you just select a deformer already in your scene (or add one in the standard way) and press the PyDeform button to make it scale and move into position.  But, that's a personal preference nit pick... it's  pretty nice how it is too.

Thanks again for the cool plug.

Edited by zenpunk, 02 February 2012 - 10:49 PM.


#3 deepshade

  • Regular Member
  • 870 posts
  • C4D Version:13 Studio
  • Location: Kent UK

Posted 03 February 2012 - 12:49 AM

Zenpunk

Issues you need to resolve - keep in mind for this type of script to be efficient  - you really need to have as few operations for the user as possible

How does the script know what you want to 'fit' the deformer to?
OK - make that the selected object

How does the script know which type of deformer

Pre set it from a list and have one deformer insert for each variation of the script - one for twist - one for bend...etc


OR - go the deformer first route

Have the script assume that the selected object is the deformer
& you've already inserted Under the object you want to resize to

I'll happily post both variations of this script free here if needed.

Problems like this can be solved with small scripts  - and posting that code  helps the community - both in providing a helper utility and showing other users  how to make use of scripting languages available in the app.
If we all charged for every single bit of advice and help/code - there would not be a community here.


If the plugin develops into something bigger than can be accomplished by minimal scripting, then of course its worth a look - but I don't think we should be mercenary with simple helpers - especially as others have already done the same across the app with COFFEE and made the code public.

Edited by deepshade, 03 February 2012 - 03:46 AM.


#4 deepshade

  • Regular Member
  • 870 posts
  • C4D Version:13 Studio
  • Location: Kent UK

Posted 03 February 2012 - 01:12 AM

Place def under your object to size to (as child)
select the object to size to
run script

works with  twist,bulge,shear, taper or bend

min checking - errors reported to console as print statement - you could make the gui pop ups if you wanted



import c4d 
from c4d import gui,documents

def main():
	if op is None: return
	ac_ob = doc.GetActiveObject()
	dwn_ob = ac_ob.GetDown()
	if dwn_ob is None:
		print "Need twist,bulge,shear, taper or bend object under your selected object" 
		return

	m = ac_ob.GetMg()
	dwn_ob.SetMg(m)

	boundingbox = ac_ob.GetRad()*2

	if not isinstance( dwn_ob[c4d.DEFORMOBJECT_SIZE], c4d.Vector):
		print "Not twist,bulge,shear, taper or bend"
		return

	dwn_ob[c4d.DEFORMOBJECT_SIZE]=boundingbox
	c4d.EventAdd()

if __name__=='__main__':
	main()


#5 deepshade

  • Regular Member
  • 870 posts
  • C4D Version:13 Studio
  • Location: Kent UK

Posted 03 February 2012 - 01:17 AM

and the....  
Insert deformer from preset version posted elsewhere on the cafe


Maybe not as robust as it could be,  but does the job

Select your object to match to
& run script


Deformer inserted under selected object and matched to size

You can choose the deformer type by removing comment # and puting it on the one you want to switch off
creating a set of 5 scripts in all


import c4d
from c4d import gui,documents

def main():
	if op is None: return

	sel_ob = doc.GetActiveObject() #get selected object
	if sel_ob is None: return  # dont do anyhting if nothing selected

	m = sel_ob.GetMg() # save the global matrtix of the selected object
	boundingbox = sel_ob.GetRad()*2 # get the bounding radius * 2

	doc.StartUndo() #start undo support
	defmr = c4d.BaseObject(c4d.Otwist)  # take your pick! uncomment the one you want
	#defmr = c4d.BaseObject(c4d.Obend)
	#defmr = c4d.BaseObject(c4d.Oshear)
	#defmr = c4d.BaseObject(c4d.Obulge)
	#defmr = c4d.BaseObject(c4d.Otaper)

	doc.AddUndo(c4d.UNDOTYPE_NEW, defmr) #support redo the insert operation
	defmr.InsertUnder(sel_ob)  #insert the deformer under the selected object

	down_ob = sel_ob.GetDown() # get the object inserted below selected object

	doc.AddUndo(c4d.UNDOTYPE_CHANGE_NOCHILDREN, defmr) # save again?

	down_ob[c4d.DEFORMOBJECT_SIZE]=boundingbox # set size
	down_ob.SetMg(m) # set matrix
	c4d.EventAdd() # refresh C4D

	doc.EndUndo()   #close the undo support


if __name__=='__main__':
	main()


Edited by deepshade, 03 February 2012 - 01:17 AM.


#6 MarcPearson

  • Regular Member
  • 23 posts
  • C4D Version:13 Studio
  • Location: Texas

Posted 03 February 2012 - 11:11 AM

zenpunk,

Thanks for the knid words! I welcome any and all suggestions for improvements. As I mentioned in the video...this product will have more features and flexibility than anything currently available, and I will do my best to get user suggestions incorporated. However, deepshade is correct. To make it user friendly and computationaly efficient, there have to be clear order of operations for both the user and the sofware. It is all about making your work faster.

deepshade,

I totally respect your thoughts. Thats why I released the PyBend Script for free...to help other designers. This tool was something I developed for several reasons:

1. In my opinion, for what its worth, I believe that Python will eventually replace COFFEE, thus making all other variants obsolete.
2. In my own workflow I found a need and challenged myself to build something completely new to me and something that could help my workflow. I am a designer by trade, but I realize the power that Python or any scripting language has in how we do our work.
3. I think the most important reason...there are a lot of designers that have absolutely no interest in coding or scripting. Coding in any language can de daunting and time consuming if there is no familiarity with the process.

Thats where people like you and I can help the community at large. Yes this particular product is being offered at a reasonable cost, but my offerings to the community do not and will not stop there. I think "mercenary" is a bit harsh. PyDeform is there to help those that cannot or do not have the time.



Also tagged with Plugins, Python

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users