THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/05/2012 at 11:02, xxxxxxxx wrote:
Thanks. That is the correct ID#.
Here's a list of how to change all of the Project Settings:
##### Scene Scale & Units options
import c4d
def main() :
pScale = doc[c4d.DOCUMENT_DOCUNIT] #Get the ProjectScale value
value = c4d.UnitScaleData #Create a UnitScaleData type variable
pScale.SetUnitScale(1.0, c4d.DOCUMENT_UNIT_CM) #Change the Scene's scale and measure type settings
doc[c4d.DOCUMENT_DOCUNIT]=pScale #Make the changes happen from memory
doc.Message(c4d.MSG_UPDATE) #Update C4D about the changes
c4d.EventAdd()
if __name__=='__main__':
main()
##### Project Settings
#Set up BaseTime so we can use it later on in the attributes
fps = doc.GetFps()
frame = doc.GetTime().GetFrame(doc.GetFps())
# doc[c4d.DOCUMENT_DOCUNIT]= See above
doc[c4d.DOCUMENT_FPS] = 30 # Sets the FPS attribute
doc[c4d.DOCUMENT_TIME]= c4d.BaseTime(0, fps) # The frame where the scrubber starts
doc[c4d.DOCUMENT_MINTIME]= c4d.BaseTime(0, fps) # The start frame value
doc[c4d.DOCUMENT_MAXTIME]= c4d.BaseTime(90, fps) # The end Frame value
doc[c4d.DOCUMENT_LOOPMINTIME]=c4d.BaseTime(0, fps) # The Preview option Start time
doc[c4d.DOCUMENT_LOOPMAXTIME]=c4d.BaseTime(90, fps) # The Preview option End time
doc[c4d.DOCUMENT_LOD]=1.0 # Level of Detail
doc[c4d.DOCUMENT_RENDERLOD]=False # Render LOD in Editor
doc[c4d.DOCUMENT_USEANIMATION]=True # Use Animation
doc[c4d.DOCUMENT_USEEXPRESSIONS]=True # Use Expressions
doc[c4d.DOCUMENT_USEGENERATORS]=True # Use Generators
doc[c4d.DOCUMENT_USEDEFORMERS]=True # Use Deformers
doc[c4d.DOCUMENT_USEMOTIONSYSTEM]=True # Use Motion System
doc[c4d.DOCUMENT_DEFAULTMATERIAL_TYPE]= 1 # 0=WHITE, 1=GREY-BLUE, 2=USER
doc[c4d.DOCUMENT_CLIPPING_PRESET]=1 # 3=TINY, 0=SMALL, 1=MEDIUM, 2=LARGE, 4=HUGE, 5=CUSTOM
doc[c4d.DOCUMENT_CLIPPING_PRESET_NEAR]=1.0 # Sets the Near clipping value
doc[c4d.DOCUMENT_CLIPPING_PRESET_FAR]=100000.0 # Sets the Far clipping value
doc[c4d.DOCUMENT_LINEARWORKFLOW]=True # Use Linear Workflow
doc[c4d.DOCUMENT_COLORPROFILE]=1 # 0=SRGB, 1=LINEAR, 2=DISABLED;
///// Info Settings
doc[c4d.DOCUMENT_INFO_AUTHOR]= "" //Type your name in here
doc[c4d.DOCUMENT_INFO_COPYRIGHT]= "" //Type your copyright info here
doc[c4d.DOCUMENT_INFO_README]= "" // Type your notes here
///// Dynamics Settings
sh = doc.FindSceneHook(180000100)
sh[c4d.WORLD_ENABLED]=True
sh[c4d.WORLD_DISABLE_DURING_LEAP]=True
sh[c4d.WORLD_TIMESCALE]=1.0
sh[c4d.WORLD_GRAVITY]=1000.0
sh[c4d.WORLD_DENSITY]=1.0
c4d.EventAdd()
//CACHE
fps = doc.GetFps()
frame = doc.GetTime().GetFrame(doc.GetFps())
sh = doc.FindSceneHook(180000100)
c4d.CallButton(doc.FindSceneHook(180000100), c4d.WORLD_CACHE_BAKE) //Executing the Bake dynamics cache buttons
c4d.CallButton(doc.FindSceneHook(180000100), c4d.WORLD_CACHE_CLEAR) //Execute the Clear dynaimcs cache button
sh[c4d.WORLD_CACHE_USE]=False
sh[c4d.WORLD_CACHE_DISABLE_BAKED_OBJECTS]=False
sh[c4d.WORLD_CACHE_USE_TIME]=False
sh[c4d.WORLD_CACHE_TIME]=c4d.BaseTime(0, fps)
c4d.EventAdd()
//EXPERT
sh = doc.FindSceneHook(180000100)
sh[c4d.WORLD_MARGIN]=1
sh[c4d.WORLD_SCALE]=100
sh[c4d.WORLD_CONTACT_RESTITUTION_LIFETIME]=5
sh[c4d.WORLD_SEED]=0
sh[c4d.WORLD_SUBSTEPS]=5
sh[c4d.WORLD_ITERATIONS]=10
sh[c4d.WORLD_ERROR_THRESHOLD]=10
c4d.EventAdd()
//VISUALIZATION
sh = doc.FindSceneHook(180000100)
sh[c4d.WORLD_VISUALIZE]=False
sh[c4d.WORLD_VISUALIZE_SHAPES]=True
sh[c4d.WORLD_VISUALIZE_AABBS]=True
sh[c4d.WORLD_VISUALIZE_CONTACT_POINTS]=True
sh[c4d.WORLD_VISUALIZE_CONSTRAINTS]=True
c4d.EventAdd()
//Key Interpolation
sh = doc.FindSceneHook(465001535)
sh[c4d.TLWORLD_OVERDUB]=False
sh[c4d.TLWORLD_LOCKV]=False
sh[c4d.TLWORLD_AUTO]=True
sh[c4d.TLWORLD_LOCKTA]=False
sh[c4d.TLWORLD_BREAK]=False
//Spline types
sh[c4d.TLWORLD_INTER]=c4d.TLWORLD_INTER_SP #Spline type
sh[c4d.TLWORLD_INTER]=c4d.TLWORLD_INTER_LI #linear type
sh[c4d.TLWORLD_INTER]=c4d.TLWORLD_INTER_ST #Step type
sh[c4d.TLWORLD_LOCKT]=False
sh[c4d.TLWORLD_CLAMP]=True
sh[c4d.TLWORLD_LOCKTL]=False
sh[c4d.TLWORLD_KEEPVISUALANGLE]=False
-ScottA