On 23/06/2013 at 08:30, xxxxxxxx wrote:
Hi,
I hope someone can help me with my tiny problem if its not to much bother?
I've been trying to find a way to perform a similar function to the command line where by you can drag an objects property to the command line and it will give the details of that property. Is there any way to replicate this so that a user could highlight an objects property and a script act upon that highlighted property of that selected object?
I wasn't sure if it was possible so tried to go down a different route and it looks like I may be going down the wrong route. I've tried to make a text field input that a user can copy and paste from the command line into the text field and then get a script to work on that, but with no luck.
Has any one had any luck with this or a similar approach, I'd appreciate any ideas?
import c4d
import re
def main() :
obj = op.GetObject()
ud = op[c4d.ID_USERDATA,2]
pat = re.compile(r'[.*]')
strip_ud = pat.search(ud).group(0)
udata = "obj"+strip_ud
# This wont work as its a string not the actual objects property
udata = 500
# Below is what I'm trying to replicate.
#obj[c4d.PRIM_TUBE_HEIGHT] = 500
Here is a link to the scene file to: https://dl.dropboxusercontent.com/u/2802779/userdata_Aa.zip
Thanks guys