Jump to content
3DCoat Forums

Quesion: How to select the current sculpt object in the scene to some other operation (just like cal volume or size ) in python script ?


Sandu
 Share

Go to solution Solved by poeboi,

Recommended Posts

  • Member

I  read the python  api doc ,but I can't figure out  how to select the current sculpt object to do some other operations .  

code like this :

import coat

vol = coat.Volume.getVolume()

print (vol )

coat.dialog().params(vol).ok().show()

I don't know what goes wrong .need some tips and help  .Thankyou

  • Contributor
  • Solution
Carlosan
This post was recognized by Carlosan!

poeboi was awarded the badge 'Helpful' and 1 points.

Hello, this is how you can get reference to Volume which is left mouse button selected in Vox Tree
 

# import the module coat
import coat

# get selected scene element
scene_element = coat.Scene.current()

# scene_element.Volume will get reference to selected object volume, can then use 
print(scene_element.Volume())
# it does not have a default string but console should print something meaningful

# rudimentary example, get number of points from Volume and print to the console
print(scene_element.Volume().getPolycount())

all Volume member functions :

https://pilgway.com/files/3dcoat/PythonAPI/classcoat_1_1_volume.html#a22d52d8c660cf85808a1eaab3ae6986f 
 

Edited by poeboi
() at end of member
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...