cubemap saving on the fly

I’m wondering if there’s a way to capture the cubemap from a scene and apply the cubemap without having to save out to the disk,

right now the only way I know is

cubemapfile = 'tmp/cube_#.jpg' 
base.saveCubeMap(cubemapfile, size = 256)
tex = loader.loadCubeMap(cubemapfile)

Yes. Use
Something like this:

rig = reflective_object.attachNewNode("rig")
buffer ="WeaponReflection", 128, rig)

reflective_object.setTexGen(TextureStage.getDefault(), TexGenAttrib.MWorldCubeMap)