|1 Week Ago|
[C4D Python] Script for get all objects in the document or under a xref
this is Steffen from Germany. On my recent project I need a little help with a hopefully easy way to solve.
I am using the order doc.GetObjects()
My problem is, that it only get objects without children. Is there a similar order for getting:
- all objects in the document?
- all objects within a specific folder/xref?
Reason is, that I will apply a source file through a xref with many nodes. The nodes are named by materials and that materials should be applied automatically. The last part is not a problem, only the first thing that doc.GetObjects() is taking only the first parents in the scene.
Would appreciate if someone could help.
|6 Days Ago|
just hit render once moreportfolio
Dipl. Industrial Designer
You need to cycle through all your obkects,
This should do the trick,
But it would be splendid if Maxon implemented a dedicated python function for this dayly task ...
|2 Days Ago|
What I did now: I cycled through all objects, selected all polygon objects in a list. Works fine so far.
Next I wanted to apply the materials with the same name to the objects. Worked as well good. The problem was, that if I apply the script another time, it applies the materials another time.
So my plan was, first to delete the existing material tags.
Then for each polygon object, I created a list of my tags. For each step I printed a result, to check, where my problem is.
I have 18 poly objects in my objList. It prints "18 objects selected"
In my test file I have applied 6 materials to each poly objects. No other tags visible. But it prints "8 tags selected".
So I printed the tag list itself. It showed beside six texture tags a polygon tag and a point tag. So my for loop stops in the moment when there is no texture tag anymore but the list shows still two objects remaining .
Can someone help me to separate the texture tags from those other ones?
|reply share thread|