/ dreamtalk.py
dreamtalk.py
1 """ 2 DreamTalk Canonical Imports 3 4 This module provides the clean, philosophical import syntax for DreamTalk. 5 It's the recommended way to import DreamTalk for new projects. 6 7 Usage: 8 from DreamTalk.dreamtalk import * 9 10 Or selectively: 11 from DreamTalk.dreamtalk import Holon, Dream, Length, Bipolar, State 12 13 The canonical names reflect holonic philosophy: 14 - Holon: A whole that is also a part (composite objects) 15 - Dream: A scene/animation (the composition space) 16 - Observer: The camera/viewpoint 17 - State: A discrete configuration for agentic holons 18 19 Parameter types map to C4D UserData: 20 - Length: Distance/size (0 to infinity) 21 - Angle: Rotation (0 to 2pi) 22 - Bipolar: Signed normalized (-1 to 1) 23 - Completion: Progress/opacity (0 to 1) 24 - Color: RGB color 25 - Integer: Whole number 26 - Bool: Boolean flag 27 """ 28 29 # Note: Module reloading is handled by run_dreamtalk() which clears the scene 30 # and provides fresh imports. No explicit reloads needed here - they cause 31 # circular import issues due to Cinema 4D's module caching behavior. 32 33 34 # ============================================================================= 35 # Core Classes - The holonic building blocks 36 # ============================================================================= 37 38 # Holon: A composite object - a whole that is also a part 39 from DreamTalk.objects.abstract_objects import Holon 40 41 # Dream: The scene/animation space 42 from DreamTalk.scene import Dream, TwoDDream, ThreeDDream 43 44 # Observer: The camera/viewpoint 45 from DreamTalk.objects.camera_objects import Observer 46 47 48 # ============================================================================= 49 # Parameter Types - Semantic types for UserData 50 # ============================================================================= 51 52 from DreamTalk.xpresso.types import ( 53 Length, # Distance/size (0 to infinity) 54 Angle, # Rotation (0 to 2pi) 55 Bipolar, # Signed normalized (-1 to 1) 56 Completion, # Progress/opacity (0 to 1) 57 Color, # RGB color 58 Integer, # Whole number 59 Bool, # Boolean flag 60 ) 61 62 63 # ============================================================================= 64 # State Machine Support - For agentic holons 65 # ============================================================================= 66 67 from DreamTalk.xpresso.states import State 68 69 70 # ============================================================================= 71 # Geometry Primitives - Common shapes 72 # ============================================================================= 73 74 from DreamTalk.objects.line_objects import ( 75 Circle, 76 Rectangle, 77 Square, 78 Arc, 79 Helix, 80 Spline, 81 Triangle, 82 ) 83 84 from DreamTalk.objects.solid_objects import ( 85 Sphere, 86 Cube, 87 Cone, 88 Plane, 89 ) 90 91 92 # ============================================================================= 93 # Constants - Colors and math 94 # ============================================================================= 95 96 from DreamTalk.constants import ( 97 # Colors 98 WHITE, BLACK, BLUE, RED, GREEN, YELLOW, PURPLE, 99 # Math 100 PI, 101 # Scene settings 102 FPS, ASPECT_RATIO, 103 ) 104 105 106 # ============================================================================= 107 # Animation - Animators for common operations 108 # ============================================================================= 109 110 from DreamTalk.animation.abstract_animators import ( 111 Create, 112 Draw, 113 Move, 114 Scale, 115 Rotate, 116 FadeIn, 117 FadeOut, 118 ) 119 120 121 # ============================================================================= 122 # __all__ - What gets exported with "from dreamtalk import *" 123 # ============================================================================= 124 125 __all__ = [ 126 # Core classes 127 'Holon', 'Dream', 'TwoDDream', 'ThreeDDream', 'Observer', 128 129 # Parameter types 130 'Length', 'Angle', 'Bipolar', 'Completion', 'Color', 'Integer', 'Bool', 131 132 # State machine 133 'State', 134 135 # Geometry 136 'Circle', 'Rectangle', 'Square', 'Arc', 'Helix', 'Spline', 'Triangle', 137 'Sphere', 'Cube', 'Cone', 'Plane', 138 139 # Constants 140 'WHITE', 'BLACK', 'BLUE', 'RED', 'GREEN', 'YELLOW', 'PURPLE', 141 'PI', 'FPS', 'ASPECT_RATIO', 142 143 # Animators 144 'Create', 'Draw', 'Move', 'Scale', 'Rotate', 'FadeIn', 'FadeOut', 145 ]