Jump to content
Sign in to follow this  
edrhine

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

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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©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

Share this post


Link to post
Share on other sites

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!!

Share this post


Link to post
Share on other sites

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©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()

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...