[Robotics] Access to the hide property of an object from a Blender Python Script.

koen buys koen.buys at mech.kuleuven.be
Tue Jan 11 16:15:13 CET 2011


Hi all,

I'm currently updating an old script that adapts some of the
properties of objects.
In the code I now want to change the hide property of the object:

            logger.debug("SimObject.updateAvailableAnchorsPointsList():
anchorpoint name: " + anchorPoint.name)
            logger.debug("SimObject.updateAvailableAnchorsPointsList():
anchorpoint type: " + anchorPoint.type)
            anchorPoint.hide = False

However my console output gives the following error:

2011-01-11 16:12:56,184 - SimCreatorPanel_Script.py - DEBUG -
SimObject.updateAvailableAnchorsPointsList(): anchorpoint name:
AnchorP_ground and object name: AnchorP_ground
2011-01-11 16:12:56,184 - SimCreatorPanel_Script.py - DEBUG -
SimObject.updateAvailableAnchorsPointsList(): anchorpoint name:
AnchorP_ground and object name: AnchorP_ground
2011-01-11 16:12:56,184 - SimCreatorPanel_Script.py - DEBUG -
SimObject.updateAvailableAnchorsPointsList(): anchorpoint type: EMPTY
2011-01-11 16:12:56,184 - SimCreatorPanel_Script.py - DEBUG -
SimObject.updateAvailableAnchorsPointsList(): anchorpoint type: EMPTY
Traceback (most recent call last):
  File "SimCreatorPanel_Scrip", line 687, in draw
  File "SimCreatorPanel_Scrip", line 1432, in drawAddRobotBox
  File "SimCreatorPanel_Scrip", line 909, in drawAnchorPointSelectionButtons
  File "SimCreatorPanel_Scrip", line 772, in updateAvailableAnchorPoints
  File "SimCreatorPanel_Scrip", line 125, in updateAvailableAnchorPointsList
  File "SimCreatorPanel_Scrip", line 445, in updateAvailableAnchorsPointsList
RuntimeError: Writing to ID classes in this context is not allowed:
AnchorP_ground, Object datablock, error setting Object.hide

location:<unknown location>:-1

location:<unknown location>:-1

Anybody a hint why I cant access this object?
If I try to add this property from the python console within blender I
have no problem changing it.

Greets,

Koen Buys


More information about the Robotics mailing list