Jump to content
The Dark Mod Forums

Textool Revamped


Recommended Posts

SneaksieDave, I've got something you will probably like :)

 

textoolv4qw7.th.jpg

 

Download the latest snapshot here: http://208.49.149.118/TheDarkMod/DarkRadia..._latest_SVN.zip

 

I rewrote the TextureTool (mostly from scratch) so that it has its own window now instead of being an attachment to the Surface Inspector. You probably will have to assign a shortcut in the Shortcut Editor for now (the command is named TextureTool).

 

Things that work

- The texture space of the selected objects is visualised. Similar to Blender, but infinite.

- U/V coord editing of the seleceted Patches. Changes are updated in realtime.

- Zooming and origin mouse drag is analogous to the XYView (they use the same buttons/modifiers)

- Multiple vertex controls can be selected and translated at the same time.

- Drag rectangle selection of multiple vertices.

- Only objects using the very same shader can be edited in the TexTool (everything else wouldn't make sense).

- Brush Face support (whole brushes as well as single faces)

- Better visual representation of the patches/brushes.

- Grid Display (Resize grid with Shift-Plus and Shift-Minus)

- Grid Snapping of the U/V operations

- Grid Snapping of selected items (Shift-G)

- ESC is propagated to the main window if nothing is selected.

- Most important commands are available via the Toolbar

- Vertex U/V "merging" (standard shortcut: Alt-M).

- All operations are undo-able

 

Things that don't work yet / things that are planned

- Disable the display of "ineffective" patch vertices (not every control vertex of a patch is actually used regarding its texture coords).

 

Please try it out and give me feedback!

Link to comment
Share on other sites

Now that's what we need, a REAL U/V editor. I look forward to trying this out.

 

If you are planning to add vertex snapping to the grid, then I suspect vertex snapping to other vertices (i.e. to align adjacent patches) will be very welcome as well.

Link to comment
Share on other sites

If you are planning to add vertex snapping to the grid, then I suspect vertex snapping to other vertices (i.e. to align adjacent patches) will be very welcome as well.

That's what I meant in the above post with "vertex merging (like Alt-M in Blender)". :)

 

I'm currently working on the brush faces, if everything goes well, I'll have that in till I go to sleep.

 

edit: updated my first post

Link to comment
Share on other sites

Oh holy shit, this is awesome. :blink:

 

I've only used it about 5 mins so far, but lemme give quick thoughts while they're in my head:

 

- I assume the fact that you can't use ESC to deselect a face while the textool has focus is intentional, because it deselects vertices? Understandable if so.

- Doesn't seem like you can currently undo a change

- Any chance to make the window extend as far as we want (repeat the texture), or have the control points wrap around? [Edit: wait a second.. maybe that's not necessary; I cleared the selection (two arches like yours above) and then reselected, and I guess the too resized itself to show more of the texture space)] [Double Edit: nevermind completely - I see you can pan the texture around - I was trying to resize the window; user error]

- I seem to be unable to get what you have in your image above, one brush face + patches selected. Once I add the different type, textool goes blank/black. [Edit: nevermind! user error. Both selected items must have the same texture as stated above]

 

Edit: I can't select brush vertices to manipulate them individually, but I'm guessing that's going to be impossible. I think?

Edit: Thinking further on that question, I must admit I'm not sure at all. If a user were to grab the bottom row of a rectangular face, for instance, they could drag it down for a scale operation. However, what if they only pulled one vertex down? There could be a non-orthogonal warp or even twist of a texture. Not sure if that's possible.

 

Edit: A couple of suggestions:

1. A method to select all from a given face. Like "L" in Blender (if I remember correctly). This way the user can grab all and move them out of the way, or move them as a whole, etc. Makes it easier when another face is in front of it.

2. Retain selection when faces are added or subtracted. Currently, all selected control points are cleared when a new face is selected or deselected. Makes it harder to work with two or more patches which are all textured the same (and are thus occupying the same space.

 

This is a really incredible addition. Back to it, I doubt I'm going to be able to digest all the possibilities on this quickly. Most edited post evar! Getting groggy. Making less sense. Need sleep.

Link to comment
Share on other sites

- I assume the fact that you can't use ESC to deselect a face while the textool has focus is intentional, because it deselects vertices? Understandable if so.

Yes, I let the window catch the ESC key to make it more intuitive. I also thought about pressing ESC twice to let the "Deselect" command propagate to the main window (first ESC = deselect texture vertices, another ESC = deselect the actual brushes/patches).

 

- Doesn't seem like you can currently undo a change

I was already working on that, but my first attempt failed. This is on the plate. :)

 

Edit: I can't select brush vertices to manipulate them individually, but I'm guessing that's going to be impossible. I think?

Yes, vertex editing for brushes is impossible, although (as you already stated), a scaling would be possible. I will probably remove the corner vertices and replace them by axis-aligned scale manipulators. With rectangular faces, it would be ok to have the manipulators on each edge, but with more than four-sided faces this won't work.

 

1. A method to select all from a given face. Like "L" in Blender (if I remember correctly). This way the user can grab all and move them out of the way, or move them as a whole, etc. Makes it easier when another face is in front of it.

Agreed, this would be helpful. Don't know how hard this would be to achieve, but I'll see to it.

 

2. Retain selection when faces are added or subtracted. Currently, all selected control points are cleared when a new face is selected or deselected. Makes it harder to work with two or more patches which are all textured the same (and are thus occupying the same space.

This may be impossible, but I'll try to think of a solution. Currently, the TexTool gets notified upon selection change, but it is not possible to compare the previous selection to the current one, you just get a bunch of objects. It could be the same face as selected before or it could be a patch, you can never know.

 

Perhaps it's possible to link the TexTool more deeply into the SelectionSystem, so it may be possible to get a grip on what exactly happened during the last selection change.

Link to comment
Share on other sites

Perhaps it's possible to link the TexTool more deeply into the SelectionSystem, so it may be possible to get a grip on what exactly happened during the last selection change.

 

It wouldn't be a good idea to "link" them together, but you might consider how the SelectionSystem interface could be upgraded to provide the information you need.

Link to comment
Share on other sites

Yes, that's of course a better idea. I'm not sure if it's possible, because the selectionsystem is an astonishingly winded maze of callbacks. If you select or deselect a single instance, the call passes through the RadiantSelectionSystem class several times, going in and out. Each helper class seems to be provided with a SelectionChangedCallback that points back to the RadiantSelectionSystem, sometimes this callback is even passed deeper in the "hierarchy", if that name is even appropriate.

 

I played with the thought of re-writing it, but that won't be very wise probably, because it works after all.

Link to comment
Share on other sites

I also thought about pressing ESC twice to let the "Deselect" command propagate to the main window (first ESC = deselect texture vertices, another ESC = deselect the actual brushes/patches).

Interesting, that could work. Assuming ESC always deselects everything in the textool, which I guess it would. Unless there was an ultra cool per-brush deselection stack... ;)

This is on the plate.

Woot, good to know. I think I comprehended everything else. :)

Link to comment
Share on other sites

Keeps getting better! Only problem I've had:

- ESC is propagated to the main window if nothing is selected.

Did that make it into the upload version? Doesn't seem to work for me. With the textool having focus, I select some control points, and then ESC to clear them, and ESC again (and again) to try to deselect the patch, but nothing happens.

 

Edit: Also, after snapping to grid, how does one turn off grid snapping again? I seem to have it stuck on.

Link to comment
Share on other sites

Also, might want to have a look at this: http://208.49.149.118/thedarkmod/maps/9arch.zip

 

I was trying to use the TexTool to make what was being discussed earlier, a continuous texture across two arch patches (I won't keep you in suspense, it worked :)). But I found something weird:

 

http://img81.imageshack.us/my.php?image=tt1ls7.jpg

 

Note that the two arches are not texture aligned in the picture (if you can't tell from the image, have a look in the map), even though the rotation is correct and according to the textool, they should be aligned.

 

When I went back to the textool, and overlapped them by four grid units, now they are aligned on the patches.

 

http://img264.imageshack.us/my.php?image=tt2xm3.jpg

 

I wasn't sure if there might be some kind of offset problem, or the patch vertices are messed up or whatever, so you've got the map as well.

 

I wonder if flipping and rotating in textool would be overkill? I tried flipping a patch, like flipping a blanket - basically dragging the left edge beyond the right - but I'm not sure if it gave me the result I wanted. *ducks*

Link to comment
Share on other sites

Also, might want to have a look at this: http://208.49.149.118/thedarkmod/maps/9arch.zip

I was running into the same problem like you and I found out that the orientation in world and in texture space was different and I dragged the wrong vertices around. I will add some buttons for flipping and rotating the selected patch vertices, they will sure come in handy.

 

edit: FlipX/FlipY buttons are available now.

 

@New Horizon: Thanks. :)

Link to comment
Share on other sites

But doesn't the map (and images) show a problem, that although the points line up, the textures don't? I am actually able to get them to line up, which means I must be dragging the right ones, but only after forcing them to overlap by a certain amount (see map). It almost seems there's some kind of offset problem on the texture coords...

 

Looks like the ESC and grid issue was cleared up. :)

Link to comment
Share on other sites

I downloaded your map and was able to change the patches such that they align up properly without overlap. You had them oriented head-to-tail, that's why you had to overlap them. Try dragging a single vertex around and look at the camera view which vertex you're actually changing and you'll see what I mean.

Link to comment
Share on other sites

Is this tool officially done now, or is there more coming? Does that Blender-like 'select all for brush/patch' look like it would work?

You mean hitting L selects all connected vertices under the mouse pointer? That's not working yet, do you want me to do it?

 

Apart from that, it's more or less done, save the bugs that you will hopefully discover. :)

Link to comment
Share on other sites

If you are able to get it to work, that would rock. :wub: That feature alone is one I was wanting about 200 times last night. I was trying to manually align the front and undersides of some doorway arches, and I went throught the same routine each time:

 

-select both

-oops, they overlap. deselect one

-select all control points of the other

-drag it off of the overlap

-re-select the other for textool

-re-select the control points, now I'm ready to do some work

 

But if I wanted to change anything, return to step one. :) Plus, I was trying to do this in full screen mode, which meant that each time I clicked the camera window, I had to press alt-T (my textool hotkey) twice to toggle it off and back on*. Heh, I was going insane. With this, I could just select one control point, hit the hotkey, and then one whole brush/patch is selected, woooot.

 

*Always On Top toggle buttons for all of these dialogs would be fantastic, but I think it was indicated that was beyond GTK functions?

Link to comment
Share on other sites

*Always On Top toggle buttons for all of these dialogs would be fantastic, but I think it was indicated that was beyond GTK functions?

Seems so. There is a property for GtkWindows that should make them try to stay on top (gtk_window_set_keep_above()), but that doesn't work (I tried to implement it for the surface inspector). It's probably not working because all the other windows (xyview, camera, entity inspector) are "toplevel" windows as well, so this is presumably some kind of z-fighting.

 

As for the L + click selection: I would prefer it that the user either has to actually click a button (just pressing the L-key while pointing with the mouse is not quite something called "standard" or "expected" behaviour) or press a keyboard shortcut after the first selection.

 

I'd suggest one of these two things:

- The user selects one vertex of the patch and hits Ctrl-Plus once to select all vertices of the same patch (this is similar to the Ctrl-Plus/Ctrl-Minus behaviour in Blender).

- The user clicks with the middle button onto one of the vertices and all connected vertices are selected within the same click (could be MMB, or any button/modifier combination).

 

What do you think?

Link to comment
Share on other sites

As for the L + click selection: I would prefer it that the user either has to actually click a button (just pressing the L-key while pointing with the mouse is not quite something called "standard" or "expected" behaviour) or press a keyboard shortcut after the first selection.

Oh absolutely, I agree. I think you should select at least one control point, and then hitting a key would propagate the selection to the rest of the brush/patch.

 

I'd suggest one of these two things:

- The user selects one vertex of the patch and hits Ctrl-Plus once to select all vertices of the same patch (this is similar to the Ctrl-Plus/Ctrl-Minus behaviour in Blender).

- The user clicks with the middle button onto one of the vertices and all connected vertices are selected within the same click (could be MMB, or any button/modifier combination).

 

What do you think?

Either of those sound great to me. :)

 

A thought about the always on top issue: I can't really think of a reason why the viewports would have to be always on top windows. Maybe the solution is to take that away from them? Dialogs will always stay atop of them, and the user can toggle to close them. As it is now, I always seem to lose the Shortcuts list behind my iso view. <_< Pressing buttons like a dope, "did I just freeze up DR?!" Nope, just lost something behind the damn viewports again.

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.

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.

  • Recent Status Updates

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...