Skip to content

Commit 40c6f41

Browse files
wezurdb
authored andcommitted
direct: provide snake_case functions for some classes
Closes panda3d#147
1 parent c6dda2a commit 40c6f41

File tree

7 files changed

+189
-0
lines changed

7 files changed

+189
-0
lines changed

direct/src/actor/Actor.py

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def getBundle(self):
5050
def __repr__(self):
5151
return 'Actor.PartDef(%s, %s)' % (repr(self.partBundleNP), repr(self.partModel))
5252

53+
54+
#snake_case alias:
55+
get_bundle = getBundle
56+
5357
class AnimDef:
5458

5559
"""Instances of this class are stored within the
@@ -72,6 +76,10 @@ def makeCopy(self):
7276
def __repr__(self):
7377
return 'Actor.AnimDef(%s)' % (repr(self.filename))
7478

79+
80+
#snake_case alias:
81+
make_copy = makeCopy
82+
7583
class SubpartDef:
7684

7785
"""Instances of this class are stored within the SubpartDict
@@ -2549,3 +2557,89 @@ def renamePartBundles(self, partName, newBundleName):
25492557
for partBundleDict in self.__partBundleDict.values():
25502558
partDef = partBundleDict.get(subpartDef.truePartName)
25512559
partDef.getBundle().setName(newBundleName)
2560+
2561+
#snake_case alias:
2562+
control_joint = controlJoint
2563+
set_lod_animation = setLODAnimation
2564+
get_anim_control_dict = getAnimControlDict
2565+
get_actor_info = getActorInfo
2566+
clear_lod_animation = clearLODAnimation
2567+
reset_lod = resetLOD
2568+
fix_bounds = fixBounds
2569+
get_anim_filename = getAnimFilename
2570+
get_subparts_complete = getSubpartsComplete
2571+
verify_subparts_complete = verifySubpartsComplete
2572+
get_play_rate = getPlayRate
2573+
clear_python_data = clearPythonData
2574+
load_anims = loadAnims
2575+
set_subparts_complete = setSubpartsComplete
2576+
draw_in_front = drawInFront
2577+
get_lod_node = getLODNode
2578+
hide_part = hidePart
2579+
get_joint_transform_state = getJointTransformState
2580+
set_control_effect = setControlEffect
2581+
get_anim_controls = getAnimControls
2582+
release_joint = releaseJoint
2583+
print_anim_blends = printAnimBlends
2584+
get_lod = getLOD
2585+
disable_blend = disableBlend
2586+
show_part = showPart
2587+
get_joint_transform = getJointTransform
2588+
face_away_from_viewer = faceAwayFromViewer
2589+
set_lod = setLOD
2590+
osd_anim_blends = osdAnimBlends
2591+
get_current_frame = getCurrentFrame
2592+
set_play_rate = setPlayRate
2593+
bind_all_anims = bindAllAnims
2594+
unload_anims = unloadAnims
2595+
remove_part = removePart
2596+
use_lod = useLOD
2597+
get_anim_blends = getAnimBlends
2598+
get_lod_index = getLODIndex
2599+
get_num_frames = getNumFrames
2600+
post_flatten = postFlatten
2601+
get_lod_names = getLODNames
2602+
list_joints = listJoints
2603+
make_subpart = makeSubpart
2604+
get_anim_control = getAnimControl
2605+
get_part_bundle = getPartBundle
2606+
get_part_bundle_dict = getPartBundleDict
2607+
get_duration = getDuration
2608+
has_lod = hasLOD
2609+
print_lod = printLOD
2610+
fix_bounds_old = fixBounds_old
2611+
get_anim_names = getAnimNames
2612+
get_part_bundles = getPartBundles
2613+
anim_panel = animPanel
2614+
stop_joint = stopJoint
2615+
actor_interval = actorInterval
2616+
hide_all_bounds = hideAllBounds
2617+
show_all_bounds = showAllBounds
2618+
init_anims_on_all_lods = initAnimsOnAllLODs
2619+
get_part = getPart
2620+
add_lod = addLOD
2621+
show_all_parts = showAllParts
2622+
get_joints = getJoints
2623+
get_overlapping_joints = getOverlappingJoints
2624+
enable_blend = enableBlend
2625+
face_towards_viewer = faceTowardsViewer
2626+
bind_anim = bindAnim
2627+
set_blend = setBlend
2628+
get_frame_time = getFrameTime
2629+
remove_node = removeNode
2630+
wait_pending = waitPending
2631+
expose_joint = exposeJoint
2632+
set_lod_node = setLODNode
2633+
get_frame_rate = getFrameRate
2634+
get_current_anim = getCurrentAnim
2635+
get_part_names = getPartNames
2636+
freeze_joint = freezeJoint
2637+
set_center = setCenter
2638+
rename_part_bundles = renamePartBundles
2639+
get_geom_node = getGeomNode
2640+
set_geom_node = setGeomNode
2641+
load_model = loadModel
2642+
copy_actor = copyActor
2643+
get_base_frame_rate = getBaseFrameRate
2644+
remove_anim_control_dict = removeAnimControlDict
2645+
load_anims_on_all_lods = loadAnimsOnAllLODs

direct/src/controls/InputState.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def invalidate(self):
2121
def __hash__(self):
2222
return self._hash
2323

24+
#snake_case alias:
25+
is_valid = isValid
26+
2427
class InputStateWatchToken(InputStateToken, DirectObject.DirectObject):
2528
def release(self):
2629
self._inputState._ignore(self)
@@ -39,6 +42,9 @@ def release(self):
3942
token.release()
4043
self._tokens = []
4144

45+
#snake_case alias:
46+
add_token = addToken
47+
4248
class InputState(DirectObject.DirectObject):
4349
"""
4450
InputState is for tracking the on/off state of some events.
@@ -235,3 +241,10 @@ def debugPrint(self, message):
235241
"""for debugging"""
236242
return self.notify.debug(
237243
"%s (%s) %s"%(id(self), len(self._state), message))
244+
245+
#snake_case alias:
246+
watch_with_modifiers = watchWithModifiers
247+
is_set = isSet
248+
get_event_name = getEventName
249+
debug_print = debugPrint
250+
release_inputs = releaseInputs

direct/src/filter/CommonFilters.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,3 +536,24 @@ def delGammaAdjust(self):
536536
del self.configuration["GammaAdjust"]
537537
return self.reconfigure((old_gamma != 1.0), "GammaAdjust")
538538
return True
539+
540+
#snake_case alias:
541+
del_cartoon_ink = delCartoonInk
542+
set_half_pixel_shift = setHalfPixelShift
543+
del_half_pixel_shift = delHalfPixelShift
544+
set_inverted = setInverted
545+
del_inverted = delInverted
546+
del_view_glow = delViewGlow
547+
set_volumetric_lighting = setVolumetricLighting
548+
del_gamma_adjust = delGammaAdjust
549+
set_bloom = setBloom
550+
set_view_glow = setViewGlow
551+
set_ambient_occlusion = setAmbientOcclusion
552+
set_cartoon_ink = setCartoonInk
553+
del_bloom = delBloom
554+
del_ambient_occlusion = delAmbientOcclusion
555+
load_shader = loadShader
556+
set_blur_sharpen = setBlurSharpen
557+
del_blur_sharpen = delBlurSharpen
558+
del_volumetric_lighting = delVolumetricLighting
559+
set_gamma_adjust = setGammaAdjust

direct/src/filter/FilterManager.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,15 @@ def cleanup(self):
349349
self.nextsort = self.win.getSort() - 1000
350350
self.basex = 0
351351
self.basey = 0
352+
353+
#snake_case alias:
354+
is_fullscreen = isFullscreen
355+
resize_buffers = resizeBuffers
356+
set_stacked_clears = setStackedClears
357+
render_scene_into = renderSceneInto
358+
get_scaled_size = getScaledSize
359+
render_quad_into = renderQuadInto
360+
get_clears = getClears
361+
set_clears = setClears
362+
create_buffer = createBuffer
363+
window_event = windowEvent

direct/src/showbase/Audio3DManager.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,27 @@ def disable(self):
289289
for sound in self.sound_dict[object]:
290290
self.detachSound(sound)
291291

292+
#snake_case alias:
293+
get_doppler_factor = getDopplerFactor
294+
set_listener_velocity_auto = setListenerVelocityAuto
295+
attach_listener = attachListener
296+
set_distance_factor = setDistanceFactor
297+
attach_sound_to_object = attachSoundToObject
298+
get_drop_off_factor = getDropOffFactor
299+
set_doppler_factor = setDopplerFactor
300+
get_sounds_on_object = getSoundsOnObject
301+
set_sound_velocity_auto = setSoundVelocityAuto
302+
get_sound_max_distance = getSoundMaxDistance
303+
load_sfx = loadSfx
304+
get_distance_factor = getDistanceFactor
305+
set_listener_velocity = setListenerVelocity
306+
set_sound_max_distance = setSoundMaxDistance
307+
get_sound_velocity = getSoundVelocity
308+
get_listener_velocity = getListenerVelocity
309+
set_sound_velocity = setSoundVelocity
310+
set_sound_min_distance = setSoundMinDistance
311+
get_sound_min_distance = getSoundMinDistance
312+
detach_listener = detachListener
313+
set_drop_off_factor = setDropOffFactor
314+
detach_sound = detachSound
315+

direct/src/showbase/DirectObject.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,15 @@ def detectLeaks(self):
101101
func = choice(getRepository()._crashOnProactiveLeakDetect,
102102
self.notify.error, self.notify.warning)
103103
func('destroyed %s instance is still %s%s' % (self.__class__.__name__, estr, tstr))
104+
105+
#snake_case alias:
106+
add_task = addTask
107+
do_method_later = doMethodLater
108+
detect_leaks = detectLeaks
109+
accept_once = acceptOnce
110+
ignore_all = ignoreAll
111+
get_all_accepting = getAllAccepting
112+
is_ignoring = isIgnoring
113+
remove_all_tasks = removeAllTasks
114+
remove_task = removeTask
115+
is_accepting = isAccepting

direct/src/showbase/Messenger.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,3 +635,16 @@ def detailedRepr(self):
635635
str = str + '='*50 + '\n'
636636
return str
637637

638+
#snake_case alias:
639+
get_events = getEvents
640+
is_ignoring = isIgnoring
641+
who_accepts = whoAccepts
642+
find_all = findAll
643+
replace_method = replaceMethod
644+
ignore_all = ignoreAll
645+
is_accepting = isAccepting
646+
is_empty = isEmpty
647+
detailed_repr = detailedRepr
648+
get_all_accepting = getAllAccepting
649+
toggle_verbose = toggleVerbose
650+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy