Isotropix Forums

how to get parent target value

Clarisse Scripting related topics

how to get parent target value

Unread postby tdsj4571 » Thu Oct 15, 2020 2:24 am

Hi,

Over 1 year, I develop some scripts for our environment artists from your knowledge well.
But I meet a difficulty when I create a code to delete lights and other objects by constraint at once.

I want to get a project path from 'parent.target' of light constraint attribute.
What do I have to do?
tdsj4571
 
Posts: 9
Joined: Wed Apr 17, 2019 8:22 am

Re: how to get parent target value

Unread postby adomon » Thu Oct 15, 2020 10:34 am

Hello,

Assuming all the constraints in your lights are parent constraints

Code: Select all
# Get all the constraints objects of your light
myConstraints = ix.api.OfObjectArray()
myLight.get_attribute("constraints").get_values(myConstraints)

# Print the project path of all these objects
for constraint in myConstraints:
  print constraint.get_attribute("target").get_object().get_full_name()


Is this what you want ?

Thanks
Antoine
User avatar
adomon
 
Posts: 69
Joined: Fri Jul 01, 2016 10:22 pm

Re: how to get parent target value

Unread postby tdsj4571 » Fri Oct 16, 2020 3:44 am

your answer is what I want! Thank you!
tdsj4571
 
Posts: 9
Joined: Wed Apr 17, 2019 8:22 am


Return to Scripting