Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - CKlosters

Pages: [1]
1
Plugin Development Forum / WM PDK 2.3 Build Status on Device
« on: January 31, 2013, 10:20:17 AM »
There used to be a pstate member variable on the device to check what render state was being used by WM
I can't find it anymore in the 2.3 PDK. Can I still access that, or has it been replaced with a get function?

I used it to check if an export node was valid for rendering something to disk based on a build (in the Activate function).
In Preview mode, the export was skipped. Otherwise it would continue to the output function.

Is there any replacement for that?

Or is there a better way to render something to disk based on a normal build? The default file export seems to do it (save the file every time the world machine is being build).

Hope someone can help!

Coen

2
Hi!

I'm building a new export operator that can write out either tiled or single images.
All works fine except the preview.

I'm calling:
Code: [Select]
StoreOutputContents(output_set, output, P_PREVIEW); at the end of my activate function.
This works well the the moment the node is connected for the first time,
but after I change one of my parameters on the node itself and press OK, the node status turns red.
It doesn't enter the activate code block at that point. By changing any of the settings on nodes that lead up to the export, the status turns yellow (which is okay).
Also, by changing any of the parameters on the node, the data temporarely cooks. It's only when I press OK, that my node 'errors' (turns red)
Is there any reason for this behaviour or am I doing something wrong?


3
Plugin Development Forum / Updating Parameter Flags
« on: November 15, 2011, 03:31:52 AM »
Hi!

I'm trying to change parameter flags based on a user action.
For example: if the user toggles "Visualize" on or off, I want a parameter to be read only or editable based on the state of Visualize (true or false).

I can set flags, but can't find methods to remove them (in the Parameter object). Is there a simple way to accomplish this?
Currenlty in the activate function i do?:

Code: [Select]

bool blend_edges = BlendEdges;

// Try to blank out
if (!blend_edges)
params.GetParam(BlendStart)->setFlag(PARM_FLAG_READONLY);
else
????


4
Plugin Development Forum / text input field parameter
« on: October 26, 2011, 03:27:01 AM »
Hi,

How can I add and set the context of a simple text field parameter?
I can create int/float/bool parameters and enumerators but can't seem to find a simple method for creating a simple text input field which I can set.

Similar to the file input > file details parm.

Any help would be appreciated, regards, Coen

5
Hi,

What would be the best way to force a process to run single threaded (not sharing or accessing resources).
I'm currently working with the ANN library and need to lock some functionality on one thread.

I have tried incorporating critical sections but as soon as it enters the critical sections world machine crashes.
Any suggestions? Would there maybe be a WM function set availble that would let me access or lock threads?

Any help would be greatly appreciated!







6
Plugin Development Forum / World To Height Map Coordinates
« on: September 19, 2011, 06:58:53 AM »
Hello,

I'm trying to wrap my head around the various spaces being active or available in WM.
Creating generic filters or iterating over all coordinates fetching their corresponding world space coordinates works fine.
I'm having issues setting world space coordinates to a finite size. (retrieving hf coordinates)

I'm currently generating an array holding coordinates of size x.
Transforming this to local space coordinates works fine in preview or 2d/3d mode.
But when changing to layout mode  I get memory allocation errors.

I'm currently dividing the  TransformCoord_WorldToHF coordinates by 128, somehow my values matched the height maps values. I know this is wrong but how can
I get absolute world space coordinates relative to the height map being rendered? Is this possible?

Here's the snippet of code i'm working with

Thanks for any help.


Code: [Select]
// Create a Random Coordinate array
// Array is constructed out of world space coordinates
int generator_amount = AMOUNT;
vector<CoordF> generators;
srand(time(NULL));
for (int i=0; i<generator_amount; i++)
{
CoordF rint = CoordF(float(rand() % 129), float(rand() % 129));
generators.push_back(rint);
}

// Try and figure out local space coordinates and assign random value
for (int i=0; i<generators.size(); i++)
{
// convert to local space
CoordF local_loc = TransformCoord_WorldToHF(context, generators[i]);
Coord  flocal = Coord(int(local_loc.x/128.0f),int(local_loc.y/128.0f));
(*map)[flocal] = 1/float(rand() % 100);
}

Pages: [1]