View Full Version : Python ARGH
boom3d 09-13-2010, 02:41 AM Hi Guys,
I'm trying my hand at python. And well.... the documentation is really not helping. Either I am missing something or it is entirely incomplete.
For example....I'm trying to create an instance of an object. But there is no reference to instances in the documentation. Or rather NO documentation at all about the naming conventions of things.
Or am I missing a section? I went to the c4d.baseobject documentation expecting to see a list of objects I can create, and what name to use..... and there is nothing there.
How are we supposed to learn this?...by guessing stuff?
I'm frustrated...and I'm hoping that I'm just dumb and I'm missing something.
|
|
JoelOtron
09-13-2010, 02:58 AM
You need to create an account at Cineversity but I believe this is a free vid---might help
http://www.cineversity.com/tutorials/lesson.asp?tid=1825
There should be extensive resources for Python out there on the web. You can check the Py4d site for more info as well http://www.py4d.com/
boom3d
09-13-2010, 03:02 AM
Thanks..... but its quite hard to see the text on that tutorial, and the doc on the site seems the same as what came with R12 demo.
In the other thread someone posted this code:
c4d.INSTANCEOBJECT_RENDERINSTANCE] = True
and guess what.... no mention of that in the documentation. so how do u find out about it?.... Guess stuff? Thats really the point of the post.... just wondering if i am missing something.
C.Smith
09-13-2010, 04:07 AM
I'm frustrated...and I'm hoping that I'm just dumb and I'm missing something.
It's all in the docs. Here's examples of how to create and insert an object:
newobj = c4d.BaseObject(c4d.type)
newobj.InsertBefore(obj)
newobj.InsertAfter(obj)
newobj.InsertUnder(obj)
There's a long list if BaseObject types in the docs. They start with 'O'. Like c4d.Ocube.
C.Smith
09-13-2010, 04:14 AM
WELL, now that I look at the docs again they seem to be missing as you say. In a search there are no results for osphere or ospline. However they are the same types for coffee and c++ so you can look at that SDK. But to save you some time here they are (drumroll).......
Obase
Base object.
Opoint
Point object. (PointObject)
Opolygon
Polygon object. (PolygonObject)
Ospline
Spline object. (SplineObject)
Olight
Light.
Ocamera
Camera.
Ofloor
Floor.
Osky
Sky.
Oenvironment
Environment.
Oloft
Loft NURBS.
Offd
FFD.
Oparticle
Particle emitter.
Odeflector
Particle deflector.
Ogravitation
Particle gravitation.
Orotation
Particle rotation.
Owind
Particle wind.
Ofriction
Particle friction.
Oturbulence
Particle turbulence.
Oextrude
Extrude NURBS.
Olathe
Lathe NURBS.
Osweep
Sweep NURBS.
Oattractor
Particle attractor.
Obezier
Bezier NURBS.
Oforeground
Foreground.
Obackground
Background.
Obone
Bone.
Odestructor
Particle destructor.
Ometaball
Metaball.
Oinstance
Instance.
Ohypernurbs
Hyper NURBS.
Obend
Bend deformer.
Obulge
Bulge deformer.
Oshear
Shear deformer.
Otaper
Taper deformer.
Otwist
Twist deformer.
Owave
Wave deformer.
Ostage
Stage.
Oline
Line.
Omicrophone
Microphone.
Oloudspeaker
Loadspeaker.
Onull
Null object.
Osymmetry
Symmetry object.
Owrap
Wrap deformer.
Oboole
Boolean.
Oexplosion
Explosion deformer.
Oformula
Formula deformer.
Omelt
Melt deformer.
Oshatter
Shatter deformer.
Owinddeform
Wind deformer.
Oarray
Array.
Oheadphone
Headphone.
Oconplane
Construction plane.
Oplugin
Plugin object.
Obasedeform
Base deform object.
Opolyreduction
Polygon reduction object.
Ocube
Cube object.
Osphere
Sphere object.
Oplatonic
Platonic object.
Ocone
Cone object.
Otorus
Torus object.
Odisc
Disc object.
Otube
Tube object.
Ofigure
Figure object.
Opyramid
Pyramid object.
Oplane
Plane object.
Ofractal
Fractal object.
Ocylinder
Cylinder object.
Ocapsule
Capsule object.
Ooiltank
Oil-tank object.
Orelief
Relief object.
Osinglepoly
Single polygon object.
Osplineprofile
Profile spline object.
Osplineflower
Flower spline object.
Osplineformula
Formula spline object.
Osplinetext
Text spline object.
Osplinenside
N-sided spline object.
Ospline4side
4-sided spline object.
Osplinecircle
Circle spline object.
Osplinearc
Arc spline object.
Osplinecissoid
Cissoid spline object.
Osplinecycloid
Cycloid spline object.
Osplinehelix
Helix spline object.
Osplinerectangle
Rectangle spline object.
Osplinestar
Star spline object.
Osplinecogwheel
Wheel spline object.
Osplinecontour
Contour spline object.
Oselection
Selection object.
Osds
SDS object.
Osplinedeformer
Spline deformer object.
Osplinerail
Spline rail object.
Oatomarray
Atom array object.
Ospherify
Spherify object.
Oexplosionfx
Explosion FX object.
boom3d
09-13-2010, 04:21 AM
Thanks....I did a search in the docs for "Ocube" and got nothing except a hit of the example given at the top of the page. Searched for sphere and nothing shows up in regards to the base object ....! where is this list of objects?
boom3d
09-13-2010, 04:22 AM
GREat!!!...thank you!
donelgreeko
09-13-2010, 11:06 AM
Hi boom3d,
to get the ID name of an object just drag and drop the object it into the Python console.
About the line you posted in this thread:
c4d.INSTANCEOBJECT_RENDERINSTANCE] = True
Here the render instance option is enabled by setting a bool value to an attribute of the render instance object. This is not documentated, because the documentation of each parameter of each object would lead into a documentation size similiar to the HTML help.
But you don't need to guess the attribute name. Just visit the method BaseList2D.__init__ in the documentation. In the description of this method you find a link called "Descriptions in CINEMA 4D".
Cheers, Sebastian
boom3d
09-13-2010, 04:45 PM
Thank you guys for your help...and the trick with the console is awesome...very helpful! I'm off and running now.... dowloaded the c++ sdk and will also use that as reference if something appears as missing....
Scott Ayers
09-13-2010, 04:57 PM
This is not documentated, because the documentation of each parameter of each object would lead into a documentation size similiar to the HTML help.
Cheers, Sebastian
I have a suggestion.
Instead of going through the docs and writing a tiny example for each and every little function(which would be wonderful).
What about taking a slightly less spoon feed approach. And writing larger working examples that contain all of the functions in each class? Or as close as you can get anyway.
That would be a lot less work. But it would still allow users to see how the syntax is supposed to be constructed in a working example.
For example:
It should be fairly quick to write one or two time line examples that use all of the Ckey and CTrack functions.
That way you cover all the time line functions in one fell swoop. And it would be a lot less work.
-ScottA
CGTalk Moderation
09-13-2010, 04:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.