Forum

  • Index
  •  » Scripting
  •  » How to get a Dynamic Attribute Value from an Object selected

#1 2017-12-02 00:31:30

xiaoshibo
Member

How to get a Dynamic Attribute Value from an Object selected

Hi Ben,

Hope you are doing well on your end.

I have a question about how to Check if the dynamic attribute exists ('Glass' for example), then how to get its value in Python.

Thank you in advance,

Shibo

example:

> Transform
> Node
> Dynamic Attributes
   IOR 1.35 ---------------------------------------------------------o>
Glass 1.00 ---------------------------------------------------------o>
Spec1 0.08 ---------------------------------------------------------o>
>Geometry




I finally find out a way to get the value, but I got the error sometimes:



d = guerilla.Document()
sel = d.selection()
node = sel[0]

# The line below produces the error (RuntimeError: Unable to bind lua class rgopvalue), I have no idea what is rgovalue.
result = guerilla.SceneGraphNode.getrenderattributes(node, True)

try:

    attributes = result['attributes']
    for name, value in attributes.iteritems():
        if name == 'variable.Glass':
            print (name, value)
except:
            print 'error'

Last edited by xiaoshibo (2017-12-02 02:37:09)


Lighting Artist

Offline

 

#2 2017-12-02 13:49:55

Ben
Guerilla dev, the guy to hug

Re: How to get a Dynamic Attribute Value from an Object selected

Hi Shibo,

This is a bug. A Lua class (rgopvalue) is not properly bound in Python, and when you get the node attributes, converting the Lua value into Python will cause this exception. I'll fix that soon, sorry.

Ben


Benjamin 'Ben' Legros
Guerilla developer
http://www.guerillarender.com

Offline

 

#3 2021-10-08 16:50:27

CiaraHeaney
New member

Re: How to get a Dynamic Attribute Value from an Object selected

It's good to know about your services as they are vast. Extremely helpful to mankind according to best paper writing service reviews. I have been looking for the same. But i was a bit confused to know what is the main services you have been providing.

Offline

 

#4 2021-11-08 01:50:11

Emily5592
New member

Re: How to get a Dynamic Attribute Value from an Object selected

Yes, absolutely. We cooperate only with the most reliable international payment https://www.tetongravity.com/story/news … is-on-fire systems to provide our customers with the fastest and most secure payment options.

Offline

 
  • Index
  •  » Scripting
  •  » How to get a Dynamic Attribute Value from an Object selected

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB