Jump to content
3DCoat Forums

angelScript functionality


deadalvs
 Share

Recommended Posts

  • Member

Hi,

 

 

I'm interested in the angelScript functionalities.

 

 

Is it possible to automattedly import geometries, e.g. tons of cubes and use them to add / remove voxels from a model ?

 

e.g. start with adding a series of cubes for a building facade, then cut out the windows, ..

 

 

reason I ask is because I'm interested in combining voxels with standard procedural modeling techniques. ( not Houdini .. ;) )

 

 

let me know.

 

matt

Edited by deadalvs
Link to comment
Share on other sites

  • Reputable Contributor

Hi,

 

 

I'm interested in the angelScript functionalities.

 

 

Is it possible to automattedly import geometries, e.g. tons of cubes and use them to add / remove voxels from a model ?

 

e.g. start with adding a series of cubes for a building facade, then cut out the windows, ..

 

 

reason I ask is because I'm interested in combining voxels with standard procedural modeling techniques. ( not Houdini .. ;) )

 

 

let me know.

 

matt

I would try to ask Andrew directly, to get a detailed response (support@3d-coat.com). Sounds like a cool idea

Link to comment
Share on other sites

Yes, you may do it.
Angelscript allows you to do actions instead of UI.
First, write function that places and merges cube.
Use commands

bool cmd(string &in ID);

to press buttons (see scripting manual)

bool SetEditBoxValue(string &in ID,float val);

fo fill floatin fields.
After merging of 1 object do Step(1) command.

In so way you may merge objects. If you will not be able to get to success, I will help more, just drop me mail.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • Member

Hey,
But how to scale when there is no Edit Box in UI?

For example i get Select Tool in Retopo Room:
 

cmd("$[Page2]Select");/*Select*/
Next Transform:
cmd("$[Page2]Transform");/*Transform*/

Now i have got UI for Transform tool, and i want to scale selection to 0, but only option is to click Scale buttons, and i dont know how to set value:
cmd("$CubPrimClose::ScaleY");/*Scale Y*/

 

It would be awesome to have some log window with last command used, like in maya. It will help to learn scripting :)

Link to comment
Share on other sites

Yes, now it is impossible to input text via script now.

In next build I will introdice commands

 

void SubstituteInputText(string& val);
void SubstituteInputText1(float val);

 

so that script will look like

 

void main(){
    SubstituteInputText(200.0);
    cmd("$CubPrim::ScaleY");
    Step(1);   
}

  • Like 1
Link to comment
Share on other sites

From updated manual:

 

void SubstituteInputText(const cstring& val);

void SubstituteInputText(float val);

Substitute string or value to the next input  text dialog. You need this command if there is button that triggers input dialog to enter some text or value. Example - transform tool, ScaleY button. Code to scane object twice along

Y axis:

 

SubstituteInputText(200.0);

cmd("$CubPrim::ScaleY");

Step(1);

 

 

Link to comment
Share on other sites

  • Member

As soon as Vector3D and Matrix3D classes will be introduced in script, I will insert a lot of low-level meshing commands.

Great! 

 

Next question is if there is an option to run angelscript function, after hitting button from loaded xml UI?

To be clear:

(For Example) I open xml UI from angelscript and after clicking a button, some function from angelscript is running.

I know i can run for ex. vox() merge() (etc.) from xml UI, but running own created functions/procedures would be awesome.

 

Documentation for xml UIs would be useful. Now i'm learning how to build them, by analyzing existing xmls, so i can only recreate existing scheme.

Of course there are more important topics, like brush improvements etc. but if you'll found spare time , some scripting improvements would be welcomed :)

Link to comment
Share on other sites

  • 1 year later...
  • Member

Hi Andrew.

 

 

It's been some time, but I would like to get back to this. I finally updated to version 4.

 

Would it be possible to post the complete code to do the following steps automatted to I can just run it?

I would like to get a starting point since I only have experience in MEL and Python, nothing really C++ alike.

 

 

You also said in the posts above that some functionality was added, so I don't know the best approach anyway..

 

 

What I would like to do is the following:

 

I have 2 objs, one is voxels to be added, one is to be subtracted.

 

[1) create a new empty scene]

2) Define the two file paths as strings

3) Rename the default voxel layer and set it's resolution to e.g. '8x'

4) Load obj 1 and add the voxels to the layer

5) Load obj 2 and subtract the voxels from the layer (maybe this needs to be done with a second layer?)

6) Remove enclosed holes

7) Convert the voxels to a surface

8) Add a procedural surface noise (if possible)

9) export the surface to an obj file with a specific name

10) create a new empty scene

 

 

Please let me know.. Thanks!

 

Matt

Link to comment
Share on other sites

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...