Jump to content


Photo

C4D - Creating buttons for content?? Personal plugins and scripts

Customizing the interface

  • Please log in to reply
9 replies to this topic

#1 edrhine

edrhine

    MoGraph Demi-god

  • Members
  • 770 posts
  • Gender:Male
  • Location:Denver, CO.
  • Interests:motion, mountain biking, skiing, home brew, traveling and saracasm

Posted 16 May 2012 - 05:23 PM

Sorry about the strange title here, but wondering how I can accomplish the following. I have a lot of scene files that I have accumulated over the years, one example would be effectors that others or myself have custom made, like the push apart effector or the clone on polygon effector. What I would really like to do is take some of these and make a way to have them as a dockable button (like for a plugin or script) that would allow me to one click add that to a scene. Any thoughts on this?

Also does anyone know how to add a new tab to the interface? I would love to take the PyDeform menu and add that to a tab with the Attribute and Layer tabs in that palette.

Muchas gracias!
"It ain't about the dollar or trying to go fast. Unless you take pride in what you're doing, it won't last. Craftsmanship is a quality that some lack. You got to give people a reason for them to come back." ---- Buck 65


FREED

#2 vozzz

vozzz

    Eats, sleeps, drinks MoGraph

  • Members
  • 1,623 posts
  • Gender:Male
  • Location:New York, NY
  • Interests:In Budapest Hungary

Posted 16 May 2012 - 06:06 PM

you can make scripts, which can be made into buttons.

not sure how to get them to call certain files, but you can get them to call commands.

thats all the help i can be.

Ace5 studios
http://ace5studios.com <-portfolio

http://ace5education.com <-tutorials/blog/facebook page

 

http://plus.google.c...lekseyVoz/posts <- google+ page


#3 tcastudios

tcastudios

    MoGraph Demi-god

  • Members
  • 548 posts

Posted 16 May 2012 - 09:09 PM

The top URL of the CB is "preset://".
Then add your lib and scene to the path such as:
''' Load Object from Content Browser , tcastudios.com&#169;2011 '''
 
import c4d
from c4d import documents
 
def main():
	load = documents.MergeDocument(doc,'preset://steadybakev12.lib4d/Xref_xPLAY',True)
	if load is False:
		print 'Not Found'
		return True
	c4d.EventAdd()
	
 
if __name__=='__main__':
	main()

And, how to make tabs… really ?

Cheers
Lennart
R14+ | OSX | xfiles Cinema4D Tools

#4 edrhine

edrhine

    MoGraph Demi-god

  • Members
  • 770 posts
  • Gender:Male
  • Location:Denver, CO.
  • Interests:motion, mountain biking, skiing, home brew, traveling and saracasm

Posted 16 May 2012 - 11:04 PM

ok..ok the tabs thing might be easy but I cant seem to get them to "dock" to the other but I will figure that out I am sure. Or if not I dont deserve it.

Can you explain anymore on the above code? On the design side everything is okay, on the scripting side... uh this is the first thing I have ever done. Thanks Lennart!!
"It ain't about the dollar or trying to go fast. Unless you take pride in what you're doing, it won't last. Craftsmanship is a quality that some lack. You got to give people a reason for them to come back." ---- Buck 65


FREED

#5 tcastudios

tcastudios

    MoGraph Demi-god

  • Members
  • 548 posts

Posted 21 May 2012 - 08:19 PM

To load from CB and get the materials related to the CB item, replace
the "True" flag from earlier example with the exact Flags.
(Found in the Py SDK under MergeDocument()

Cheers
Lennart

''' Load Object with Materials from Content Browser , tcastudios.com&#169;2012 '''
 
import c4d
from c4d import documents
 
def main():
	load = documents.MergeDocument(doc,'preset://Mylib.lib4d/MyItem',c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS)
	if load is False:
		print 'Not Found'
		return True
	c4d.EventAdd()
	
 
if __name__=='__main__':
	main()

R14+ | OSX | xfiles Cinema4D Tools

#6 edrhine

edrhine

    MoGraph Demi-god

  • Members
  • 770 posts
  • Gender:Male
  • Location:Denver, CO.
  • Interests:motion, mountain biking, skiing, home brew, traveling and saracasm

Posted 21 May 2012 - 10:08 PM

Thanks Lennart! That makes more sense and will try that for sure. Overall I am really just having a problem understanding the whole context of python I guess. Besides the results I get with a google search, does anyone who regularly uses this have suggestions of good sources to start to learn this? Thanks
"It ain't about the dollar or trying to go fast. Unless you take pride in what you're doing, it won't last. Craftsmanship is a quality that some lack. You got to give people a reason for them to come back." ---- Buck 65


FREED

#7 C.Smith

C.Smith

    Sermonizes Mograph to the Masses

  • Members
  • 2,929 posts
  • Gender:Male
  • Location:Santa Monica
  • Interests:Keepin it real.

Posted 24 May 2012 - 04:01 AM

As far as docking tabs. If I'm understanding you, have you tried dragging a tabbed window on top of another tab? It should add it as a tab next to the tab you just dropped it on. You may not even have to pretab it.
chris smith :: some of my work

#8 edrhine

edrhine

    MoGraph Demi-god

  • Members
  • 770 posts
  • Gender:Male
  • Location:Denver, CO.
  • Interests:motion, mountain biking, skiing, home brew, traveling and saracasm

Posted 24 May 2012 - 03:59 PM

Hey Chris... thanks for responding. I have tired that I think but will try again both with customize on/off. What is really killing be at this point is now how to delete a palette/icon from the interface. Basically what I have done is to add a secondary "toolbar" under the main top one for commonly used content browser items, plugins and scripts so that they are buttons (CStools in there too!). However there are a few I have docked other places and would like to remove the original. I understand that I can simply reset the layout, but that seems like a weird way to go (and have to add a dozen or so items) rather than just delete one. Many thanks if you have any thoughts
"It ain't about the dollar or trying to go fast. Unless you take pride in what you're doing, it won't last. Craftsmanship is a quality that some lack. You got to give people a reason for them to come back." ---- Buck 65


FREED

#9 C.Smith

C.Smith

    Sermonizes Mograph to the Masses

  • Members
  • 2,929 posts
  • Gender:Male
  • Location:Santa Monica
  • Interests:Keepin it real.

Posted 24 May 2012 - 06:08 PM

To delete an icon, make sure you are in edit palette mode and double click an icon and it will disappear. To remove a palette, you should just right click and select 'close'. Not in front of C4D right now, but that's what I remember me thinks.
chris smith :: some of my work

#10 edrhine

edrhine

    MoGraph Demi-god

  • Members
  • 770 posts
  • Gender:Male
  • Location:Denver, CO.
  • Interests:motion, mountain biking, skiing, home brew, traveling and saracasm

Posted 24 May 2012 - 07:35 PM

finally figured out the delete ting with some help from C4D cafe. So freakin simple... all you do is double click an icon/button/palette when in the customize interface... so simple
"It ain't about the dollar or trying to go fast. Unless you take pride in what you're doing, it won't last. Craftsmanship is a quality that some lack. You got to give people a reason for them to come back." ---- Buck 65


FREED




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users