diff --git a/direct/src/distributed/ClientRepository.py b/direct/src/distributed/ClientRepository.py index eb98984386..b583fe6bf8 100644 --- a/direct/src/distributed/ClientRepository.py +++ b/direct/src/distributed/ClientRepository.py @@ -132,6 +132,7 @@ class ClientRepository(DirectObject.DirectObject): distObj = self.doId2do[doId] distObj.generate() distObj.updateRequiredFields(cdc, di) + distObj.announceGenerate() # Is it in the cache? If so, pull it out, put it in the dictionaries, # and update it. @@ -144,6 +145,7 @@ class ClientRepository(DirectObject.DirectObject): # and update it. distObj.generate() distObj.updateRequiredFields(cdc, di) + distObj.announceGenerate() # If it is not in the dictionary or the cache, then... else: @@ -158,6 +160,7 @@ class ClientRepository(DirectObject.DirectObject): # Put the new do in both dictionaries self.doId2do[doId] = distObj self.doId2cdc[doId] = cdc + distObj.announceGenerate() return distObj @@ -168,6 +171,7 @@ class ClientRepository(DirectObject.DirectObject): distObj = self.doId2do[doId] distObj.generate() distObj.updateRequiredOtherFields(cdc, di) + distObj.announceGenerate() # Is it in the cache? If so, pull it out, put it in the dictionaries, # and update it. @@ -180,6 +184,7 @@ class ClientRepository(DirectObject.DirectObject): # and update it. distObj.generate() distObj.updateRequiredOtherFields(cdc, di) + distObj.announceGenerate() # If it is not in the dictionary or the cache, then... else: @@ -194,6 +199,7 @@ class ClientRepository(DirectObject.DirectObject): distObj.generateInit() # Only called when constructed distObj.generate() distObj.updateRequiredOtherFields(cdc, di) + distObj.announceGenerate() # Put the new do in both dictionaries # self.doId2do[doId] = distObj # self.doId2cdc[doId] = cdc diff --git a/direct/src/distributed/DistributedObject.py b/direct/src/distributed/DistributedObject.py index 9662fe5853..c2dfe0b07f 100644 --- a/direct/src/distributed/DistributedObject.py +++ b/direct/src/distributed/DistributedObject.py @@ -68,6 +68,13 @@ class DistributedObject(PandaObject): messenger.send(self.uniqueName("disable")) return None + def announceGenerate(self): + """announceGenerate(self) + Sends a message to the world after the object has been + generated and all of its required fields filled in. + """ + messenger.send(self.uniqueName("generate"), [self]) + def disable(self): """disable(self) Inheritors should redefine this to take appropriate action on disable