Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/07/2011 at 01:22, xxxxxxxx wrote:
How do I create an XRef object in Python (or with C++ API, for that matter)? I can't even find a single mention of XRef in the Python documentation; am I missing something?
On 28/07/2011 at 04:07, xxxxxxxx wrote:
Use the BaseObject constructor.
import c4d op = c4d.BaseObject(c4d.Osceneinstance) doc.InsertObject(op)
Edit summary: corrected constant
On 28/07/2011 at 04:33, xxxxxxxx wrote:
If you want to get the ID of an object you can drag it into the Python console. You can pass this ID to BaseList2D or in this case to BaseObject. Cheers, Sebastian
On 28/07/2011 at 05:34, xxxxxxxx wrote:
@ Sebastian: When dragging an Object into the Console, I recieve this:
But the constant Osceneinstance is not available in the C4D Module.
On 28/07/2011 at 05:35, xxxxxxxx wrote:
Originally posted by xxxxxxxx op = c4d.BaseObject(c4d.Oxref)
Originally posted by xxxxxxxx
op = c4d.BaseObject(c4d.Oxref)
On Cinema 4D R12.048 RC42839, I don't have c4d.Oxref:
Traceback (most recent call last) : File "<console>", line 1, in <module> AttributeError: 'module' object has no attribute 'Oxref'
EDIT: Oh, I see, it's a general problem. What's the numeric value of the Oxref?
On 28/07/2011 at 05:37, xxxxxxxx wrote:
Do I need a newer Cinema 4D version?
No, I'm sorry, I used the wrong ID. For the correct ID, see the post above. But that id is also not available in the c4d module which seems like a bug to me.
Use print op.GetType() for the integer ID. (which is 200000118)
On 28/07/2011 at 05:39, xxxxxxxx wrote:
Originally posted by xxxxxxxx Use print op.GetType() for the integer ID. (which is 200000118)
Thanks, I'll try that.
On 28/07/2011 at 08:59, xxxxxxxx wrote:
Currently just a bunch of certain IDs are part of the module. In this case you can drag the object to the console, extract the ID with GetType() and define them on your own.
On 04/08/2011 at 01:47, xxxxxxxx wrote:
Thanks, determining the type ID and constructing a new BaseObject with it worked great!