CGTalk > Software > Maxon Cinema 4D
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 08-22-2012, 10:31 AM   #1
alawrence
Frequenter
Anthony lawrence
london, United Kingdom
 
Join Date: Oct 2005
Posts: 113
Sort by Object Name

Is there any way or a plugin that can help sort objects in the Object Manager alphabetically?

I have some files with hundreds of objects, all clearly named, but scattered all over the list. I would like to group these by name, but manually sorting them is taking an age. I expect to receive more files as the project develops and can see it becoming a repetitive and time consuming task.

Many thanks

alawrence
 
Old 08-22-2012, 11:04 AM   #2
Jops
hyper nerd
Florian Sepp
Germany
 
Join Date: Mar 2005
Posts: 325
i know nothing about a ascript like this. but maybe the magnifying glass symbol on the top of the object manager can help you. its a searchbox. and if you are searching for different object types the eye symbol can help.

best regards
Jops
 
Old 08-22-2012, 11:11 AM   #3
bezo
PRO
 
bezo's Avatar
portfolio
Lubo Bezek
Slovakia
 
Join Date: Jan 2008
Posts: 117
...someone was faster :-)

br, Lubo
Attached Images
File Type: jpg OM.jpg (96.5 KB, 118 views)
 
Old 08-22-2012, 11:42 AM   #4
alawrence
Frequenter
Anthony lawrence
london, United Kingdom
 
Join Date: Oct 2005
Posts: 113
Thanks

Good ideas.

These are both a bit manual and time consuming. I was hoping for something more automated.
 
Old 08-22-2012, 11:49 AM   #5
tcastudios
Steady now!
 
tcastudios's Avatar
...
Sweden
 
Join Date: Jan 2003
Posts: 4,245
See if this helps.
For use in Python ScriptsManager.

Code:
# SORT OBJECTS ALPHABETICALLY IN OM import c4d from c4d import gui def main(): obj = doc.GetFirstObject() if not obj: return True doc.StartUndo() olist = [] while obj: olist.append([obj.GetName(),obj]) obj = obj.GetNext() olist.sort() olist.reverse() for i,o in enumerate(olist): doc.AddUndo(c4d.UNDOTYPE_CHANGE,o[1]) o[1].Remove() doc.InsertObject(o[1],None,None) c4d.EventAdd() doc.EndUndo() if __name__=='__main__': main()


Cheers
Lennart
__________________
MSA | OSX | xfiles ...Cinema4D Tools
 
Old 08-22-2012, 11:53 AM   #6
bobtronic
aka bobtronic
 
bobtronic's Avatar
portfolio
Matthias Bober
3D monkey
Frankfurt, Germany
 
Join Date: Nov 2002
Posts: 2,805
It's possible if you switch to the flat tree view of the OM. Enable "Flat Tree" and "Sort by Name".
Attached Images
File Type: png sort_by_name.png (22.0 KB, 65 views)
__________________
http://www.bobtronic.com
 
Old 08-22-2012, 01:08 PM   #7
alawrence
Frequenter
Anthony lawrence
london, United Kingdom
 
Join Date: Oct 2005
Posts: 113
Many Thanks Bobtronic and Tcastudios

Many Thanks Bobtronic and Tcastudios

I have a few options to try now.

Thanks guys
 
Old 08-22-2012, 01:55 PM   #8
alawrence
Frequenter
Anthony lawrence
london, United Kingdom
 
Join Date: Oct 2005
Posts: 113
Improvements

Hello Lenart

Many thanks for your script. I can get it to work in V13 but not V11. (client still using V11 unfortunately)

This is the first time I have used a python script.Unfortunately it is well above my intelligence.

Would it be possible to extend the function of your script to group the objects under a null of the same name as the objects.

I can see really potential lifesaver for me and I could see myself using this everyday. I just love the order it brings to the files.

Best regards

alawrence

Last edited by alawrence : 08-22-2012 at 02:00 PM.
 
Old 08-22-2012, 02:15 PM   #9
tcastudios
Steady now!
 
tcastudios's Avatar
...
Sweden
 
Join Date: Jan 2003
Posts: 4,245
By me, pre R12, will not happen (someone with time would have to make it in COFFEE) and extended functionality, not any time soon I'm afraid.
But the code is open for anyone else to extend.

Cheers
Lennart
__________________
MSA | OSX | xfiles ...Cinema4D Tools
 
Old 01-22-2013, 09:08 PM   #10
palosanto
New Member
portfolio
Juan Carreras
marinevisuals.com
Garibaldi, Canada
 
Join Date: May 2012
Posts: 8
Hi tcastudios,

I'm trying to use your sorting script but unfortunately I'm a total noob when it comes to this stuff. How do I use it? I pasted the code into the python script editor and click on 'execute' but nothing happens. Is this all I have to do?
I find the need for sorting objects (without going to flat tree) a big necessity. I cant believe that Cinema cannot do that ... I'm using R14 Studio.
Can you help?
Thanks

Last edited by palosanto : 01-22-2013 at 09:13 PM.
 
Old 01-22-2013, 09:58 PM   #11
tcastudios
Steady now!
 
tcastudios's Avatar
...
Sweden
 
Join Date: Jan 2003
Posts: 4,245
Check your indents, typically 1 Tab or 4 spaces per indent.
Copy paste can be faulty, make sure you are using a
real text editor handling plain text, no formatting.

Cheers
Lennart
__________________
MSA | OSX | xfiles ...Cinema4D Tools
 
Old 01-22-2013, 10:40 PM   #12
palosanto
New Member
portfolio
Juan Carreras
marinevisuals.com
Garibaldi, Canada
 
Join Date: May 2012
Posts: 8
Hi again,
Thanks for the quick reply.
Everything seems ok but still no joy ... :(
Can you see anything? I imagine that clicking on execute or running it from the menu "user script/run script" should do the same . The file is a plain text file and it loaded like the image

 
Old 01-22-2013, 10:59 PM   #13
tcastudios
Steady now!
 
tcastudios's Avatar
...
Sweden
 
Join Date: Jan 2003
Posts: 4,245
As I said, you need to examine it in a text editor
and check the "invisibles" for any mismatching.

Any line break must be clean all tab intends must
also be clean.

The Console should tell at what line(s) there are issues.

Cheers
Lennart
__________________
MSA | OSX | xfiles ...Cinema4D Tools
 
Old 01-22-2013, 11:14 PM   #14
palosanto
New Member
portfolio
Juan Carreras
marinevisuals.com
Garibaldi, Canada
 
Join Date: May 2012
Posts: 8
Nope. No errors. No sorting ....
I tried also in R13 ... nothing.

I must be doing something basically wrong. Where can I find a super simple script to try and see whether is the script or my system?
Sorry to keep bothering you. Thanks for your patience
Juan
 
Old 01-23-2013, 12:54 AM   #15
tcastudios
Steady now!
 
tcastudios's Avatar
...
Sweden
 
Join Date: Jan 2003
Posts: 4,245
Then type it instead of CopyPaste.
Else, no clue.

Cheers
Lennart
__________________
MSA | OSX | xfiles ...Cinema4D Tools
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 10:47 AM.


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