[Robotics] links and components

Benoit Bolsee benoit.bolsee at online.be
Thu Oct 22 12:30:24 CEST 2009


Hi,

You can try this setup:
- link the object, it will appear in a layer, make sure the object is at
the origin location (must be done in the lined file). If it's not at the
origin, you can play with group offset.
- add the linked object to a group (Add to group)
- in your main scene add an Empty and parent it to the main object
- enable dupligroup on the empty and type in the name of the group of
the linked object
This will make the linked object appear in the main scene as if it was
parented to the main object.

However, when you run the BGE, this parent relation is not maintained
because the dupligroup objects are instantiated without any parent
relation. You can work around that by creating a script that parents the
linked object to the main object at startup. This will physically attach
the linked object to the main object at runtime. Here is the script
(runs on linked object):

cont = GameLogic.getCurrentController()
tool = cont.owner
robot = GameLogic.getCurrentScene().objects['OBRobot']
tool.setParent(robot)

Note that you have to name the main object because the linked object has
no other way to get a reference to it.
Doesn't sound very nice but at least it works. I cannot think of another
solution right now.

/benoit

> -----Original Message-----
> From: robotics-bounces at blender.org 
> [mailto:robotics-bounces at blender.org] On Behalf Of Nicolas Lassabe
> Sent: jeudi 22 octobre 2009 11:04
> To: Robotics at blender.org
> Subject: [Robotics] links and components
> 
> 
> Hello,
>    
>    I try to build a scene in Blender composed of different components 
> .blend (controllers, sensors ...).  When I add the components 
> by link, 
> this is nice because if I update my components, my scence 
> will be update 
> also, but the problem is my components are in read-only in 
> the scene, so 
> I cannot attach them to a parent (ex : controller to a 
> robot). A solution is to append the components to the scene 
> but If I update my 
> components this will not update my scene, it is a real 
> problem when you 
> develop and want to test and debug your components together. 
> The risk is 
> also to change a component in the scene and to have different 
> versions 
> of your component.
> 
> So there is a way to link a component to a parent ?
> 
> Cheers,
> Nicolas
> _______________________________________________
> Robotics mailing list
> Robotics at blender.org 
> http://lists.blender.org/mailman/listinfo/robo> tics
> 



More information about the Robotics mailing list