THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/12/2007 at 02:20, xxxxxxxx wrote:
Cinema 4D Version: 10.5
Platform: Mac ;
Language(s) : C.O.F.F.E.E ;
Just wondered if there were any clever people out their who is a dab hand at writing scripts. What I need is a script that finds objects that are always seen by the renderer or always seen by the editor. Basically it finds any object that has a little "green light on" which is hidden away somewhere in the sub folder of a sub folder of a sub folder, basically very time comsuming to find. This would be a great help to many others as well I guess. I would attempt to do this myself but have no experience in this field, zilch.
If anyone could help out I would be emtremely greatful.
Many thanks in advance
On 05/12/2007 at 04:55, xxxxxxxx wrote:
I have been given this script but it does'nt unfold the hierarchy to reveal the object.
var editorMode = obj#ID_BASEOBJECT_VISIBILITY_EDITOR;
var rendererMode = obj#ID_BASEOBJECT_VISIBILITY_RENDER;
if(editorMode == 0 || rendererMode == 0)
var parent = obj->GetUp();
parent = parent->GetUp();
obj = obj->GetNext();
var obj = doc->GetFirstObject();
Then somebody else posted another bit of script to fix this but i dont know how to put both bits of script together to get them to work.
state = op->GetBit(BIT_OFOLD);
CallCommand(100004802); // unfold
CallCommand(100004803); // fold
Any help would be very appreciated.
On 05/12/2007 at 09:40, xxxxxxxx wrote:
These questions arise:
1. Do you want to unfold to every object with editor/render visibility On or just a particular one?
2. If the former case, do you want each one selected as well so that the user can tell quickly (in a dense hierarchy) which ones are of interest with respect to the condition (editor/render On)?
I'm going to try to get the script working but will need these details to have the correct script.
On 05/12/2007 at 10:58, xxxxxxxx wrote:
This works - but not completely in R10+ though. Don't know why the long route to get the Editor and Render Modes (see code below). The hard part here is controlling the unfolding in R10+.
> var parent;
> for (obj; obj; obj = obj->GetNext())
> if (obj->GetEditorMode()==MODE_ON || obj->GetRenderMode()==MODE_ON)
> for (parent = obj->GetUp(); parent; parent = parent->GetUp())
> var obj = doc->GetFirstObject();
The reason that this doesn't completely work in R10+ is because the interface has changed for getting/setting bits - especially folding/unfolding. These are now controlled by four bits (for four managers) and, in C++, a new set of methods to operate on them. COFFEE, unfortunately, has not been updated for R10+. I'll see what can be done for R10+ but don't expect miracles.
On 07/12/2007 at 01:17, xxxxxxxx wrote:
Basically I would like it to work in the same way as "scroll first active", just unfolding the necessary null objects after it has isolated the objects. Other scripts put forward have opened everything down the hierarchy, but not sure if this is just an issue with C.O.F.F.E.E in C4D 10.5 as other people have told me? Thats about it really. Identify, locate, Isolate, Unfold/Find.